VS:PtPerpLine: Difference between revisions

From Vectorworks Developer
Jump to navigation Jump to search
No edit summary
 
m (1 revision)
(No difference)

Revision as of 14:36, 12 August 2013

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

Description

Returns a point on the input line which is closest to the input point. Doesn't check to see that the point is ON the line.

FUNCTION PtPerpLine(
ptX, ptY, ptZ :REAL;
begPtX, begPtY, begPtZ :REAL;
endPtX, endPtY, endPtZ :REAL) VECTOR;
def vs.PtPerpLine(pt, begPt, endPt):
    return VECTOR

Parameters

ptX, ptY, ptZ REAL
begPtX, begPtY, begPtZ REAL
endPtX, endPtY, endPtZ REAL

Example

PROCEDURE Example;
VAR
   beg_pt, END_pt, pt, r :VECTOR;
BEGIN
   CallTool(-201);
   GetSegPt1(FSActLayer, beg_pt.x, beg_pt.y);
   GetSegPt2(FSActLayer, END_pt.x, END_pt.y);
   CallTool(-221);
   GetLocPt(FSActLayer, pt.x, pt.y);
   r := PtPerpLine(pt, beg_pt, END_pt);
   Locus(r.x, r.y);
END;
RUN(Example);

Version

Availability: from All Versions

This is drop-in function.