VS:ThreePtCenter: Difference between revisions

From Vectorworks Developer
Jump to navigation Jump to search
m (1 revision)
 
No edit summary
Line 5: Line 5:
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<desc>
<desc>
Returns the center of a circle passing thru 3 given points.
Returns the center of a circle passing thru 3 given points.</desc>
</desc>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<def>
<def>
<funcDef lang="vs">
<funcDef lang="vs">
FUNCTION ThreePtCenter(pt1X, pt1Y, pt1Z :REAL; pt2X, pt2Y, pt2Z :REAL; pt3X, pt3Y, pt3Z :REAL) X, Y, Z :REAL;
FUNCTION ThreePtCenter(pt1:VECTOR; pt2:VECTOR; pt3:VECTOR) : VECTOR;
</funcDef>
</funcDef>
<funcDef lang="py">
<funcDef lang="py">
Line 23: Line 22:
<lineList ident=1>
<lineList ident=1>
<line>
<line>
pt1X, pt1Y, pt1Z
pt1
REAL
VECTOR


</line>
</line>
<line>
<line>
pt2X, pt2Y, pt2Z
pt2
REAL
VECTOR


</line>
</line>
<line>
<line>
pt3X, pt3Y, pt3Z
pt3
REAL
VECTOR


</line>
</line>
</lineList>
</lineList>
</params>
</params>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<return>
<remark></remark>
</return>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<remark>
<sample></sample>
([[User:Orso.b.schmid|Orso]], 2011 Jan. 08) This call never sets the z-value of the returned center: the z is always zero.
</remark>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<sample>
<seeAlso></seeAlso>
<code lang="pas">
PROCEDURE Example;
VAR
  pt1, pt2, pt3, center_pt :VECTOR;
BEGIN
  GetPt(pt1.x, pt1.y);
  GetPtL(pt1.x, pt1.y, pt2.x, pt2.y);
  MoveTo(pt1.x, pt1.y);
  LineTo(pt2.x, pt2.y);
  GetPtL(pt2.x, pt2.y, pt3.x, pt3.y);
  LineTo(pt3.x, pt3.y);
  center_pt := ThreePtCenter(pt1, pt2, pt3);
  Locus(center_pt.x, center_pt.y);
END;
RUN(Example);</code>
 
</sample>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<version>
<version>
Availability: from All Versions
Availability: from Vectorworks 2014


This is drop-in function.
</version>
</version>
-----------------------------------------------------------------------------------------------------------
<seeAlso>
</seeAlso>


</vwDoc>
</vwDoc>

Revision as of 17:35, 18 September 2013

.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix

Description

Returns the center of a circle passing thru 3 given points.

FUNCTION ThreePtCenter(
pt1 :VECTOR;
pt2 :VECTOR;
pt3 :VECTOR) : VECTOR;
def vs.ThreePtCenter(pt1, pt2, pt3):
    return VECTOR

Parameters

pt1 VECTOR
pt2 VECTOR
pt3 VECTOR

Version

Availability: from Vectorworks 2014