Check if three Pts are collinear, ie, on the same straight path.
first Pt
second Pt
third Pt
a threshold where a smaller value means higher precision threshold for the straight line. Default is 0.01.
Given a line segemnt and a ray (infinite line), find its intersection point(s) with a polygon.
a Group of 2 Pts representing a line or ray
a Group of Pts representing a polygon
a boolean value to treat the line as a ray (infinite line). Default is false
.
Get magnitude of a line segment
a Group of at least 2 Pts
Get squared magnitude of a line segment
a Group of at least 2 Pts
Find a point on a line that is perpendicular (shortest distance) to a target point
a target Pt
if true, this returns the projection vector instead. Default is false.
a Pt on the line that is perpendicular to the target Pt, or a projection vector if asProjection
is true.
Generated using TypeDoc
Line class provides static functions to create and operate on lines. A line is usually represented as a Group of 2 Pts. You can use the static function as-is, or apply the
op
method in Group or Pt to many of these functions. See Op guide for details.