VS:LineCircleIntersect: Difference between revisions

From Vectorworks Developer
Jump to navigation Jump to search
No edit summary
No edit summary
 
Line 57: Line 57:
<remark>
<remark>
In VS Python, this function returns 3-element tuples with gibberish in the third element regardless whether you give it 2- or 3-element tuples.
In VS Python, this function returns 3-element tuples with gibberish in the third element regardless whether you give it 2- or 3-element tuples.
This function checks the intersection of an infinite line defined by the two supplied points.
This function checks and returns the intersection of the circle with an infinite line defined by the two supplied points.
</remark>
</remark>



Latest revision as of 23:30, 26 January 2023

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

Description

Finds the intersection points of a line and a circle.

FUNCTION LineCircleIntersect(
begPt :VECTOR;
endPt :VECTOR;
cenPt :VECTOR;
radius :REAL;
VAR pt1 :VECTOR;
VAR pt2 :VECTOR) : BOOLEAN;
def vs.LineCircleIntersect(begPt, endPt, cenPt, radius):
    return (BOOLEAN, pt1, pt2)

Parameters

begPt VECTOR
endPt VECTOR
cenPt VECTOR
radius REAL
pt1 VECTOR
pt2 VECTOR

Remarks

In VS Python, this function returns 3-element tuples with gibberish in the third element regardless whether you give it 2- or 3-element tuples.

This function checks and returns the intersection of the circle with an infinite line defined by the two supplied points.

Version

Availability: from Vectorworks 2014