VS:ThreePtCenter

From Vectorworks Developer
Revision as of 14:39, 12 August 2013 by Root (talk | contribs) (1 revision)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

.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(
pt1X, pt1Y, pt1Z :REAL;
pt2X, pt2Y, pt2Z :REAL;
pt3X, pt3Y, pt3Z :REAL) X, Y, Z :REAL;
def vs.ThreePtCenter(pt1, pt2, pt3):
    return VECTOR

Parameters

pt1X, pt1Y, pt1Z REAL
pt2X, pt2Y, pt2Z REAL
pt3X, pt3Y, pt3Z REAL

Remarks

(Orso, 2011 Jan. 08) This call never sets the z-value of the returned center: the z is always zero.

Example

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);

Version

Availability: from All Versions

This is drop-in function.