Line
The Line object represents..
Constructors
Line(point1, point2[, asVector, arg3, arg4])Creates a Line object.
Parameters:
point1:Pointpoint2:PointasVector:Boolean— optional, default:falsearg3:arg4:Returns:
Line
Properties
pointThe starting point of the line.
Read only.
Type:
Point
vectorThe direction of the line as a vector.
Read only.
Type:
Point
lengthThe length of the line.
Read only.
Type:
Number
Methods
intersect(line[, isInfinite])Parameters:
line:LineisInfinite:Boolean— optional, default:falseReturns:
Point— the intersection point of the lines,undefinedif the two lines are collinear, ornullif they don’t intersect.
getSide(point[, isInfinite])Parameters:
point:PointisInfinite:Boolean— optional, default:falseReturns:
Number
getDistance(point)Parameters:
point:PointReturns:
Number
getSignedDistance(point)Parameters:
point:PointReturns:
Number
Was this helpful?