VS:PtPerpCircle: 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 a point on the circle which is closest to the input point.
Returns a point on the circle which is closest to the input point.</desc>
</desc>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<def>
<def>
<funcDef lang="vs">
<funcDef lang="vs">
FUNCTION PtPerpCircle(ptX, ptY, ptZ :REAL; cenPtX, cenPtY, cenPtZ :REAL; radius :REAL) X, Y, Z :REAL;
FUNCTION PtPerpCircle(pt:VECTOR; cenPt:VECTOR; radius:REAL) : VECTOR;
</funcDef>
</funcDef>
<funcDef lang="py">
<funcDef lang="py">
Line 23: Line 22:
<lineList ident=1>
<lineList ident=1>
<line>
<line>
ptX, ptY, ptZ
pt
REAL
VECTOR


</line>
</line>
<line>
<line>
cenPtX, cenPtY, cenPtZ
cenPt
REAL
VECTOR


</line>
</line>
Line 39: Line 38:
</lineList>
</lineList>
</params>
</params>


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


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<remark>
<sample></sample>
 
</remark>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<sample>
<seeAlso></seeAlso>
<code lang="pas">
PROCEDURE Example;
VAR
  cen_pt, pt, r              :VECTOR;
  startAng, sweepAng, Radius :REAL;
 
  PROCEDURE ArcInfo(h :HANDLE; VAR cen_pt :vector; VAR startAng, sweepAng, Radius :REAL);
  BEGIN
      Hcenter(h, cen_pt.x, cen_pt.y);
      GetArc (h, startAng, sweepAng);
      IF GetType(h) = 6 THEN Radius := Hperim(h) / Deg2Rad(sweepAng) ELSE
      IF GetType(h) = 89 THEN Radius := 5729.28 / ((100 * Hangle(h)) / Hlength(h));
  END;
 
BEGIN
  CallTool(-205);
  ArcInfo(FSActLayer, cen_pt, startAng, sweepAng, Radius);
      CallTool(-221);
  GetLocPt(FSActLayer, pt.x, pt.y);
  r := PtPerpCircle(pt, cen_pt, radius);
  Locus(r.x, r.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 a point on the circle which is closest to the input point.

FUNCTION PtPerpCircle(
pt :VECTOR;
cenPt :VECTOR;
radius :REAL) : VECTOR;
def vs.PtPerpCircle(pt, cenPt, radius):
    return VECTOR

Parameters

pt VECTOR
cenPt VECTOR
radius REAL

Version

Availability: from Vectorworks 2014