Appearance
geometry.lines
geometry.lines.getClosestPointOnSegment(px, py, ax, ay, bx, by)
Get the closest point on a segment from a point
Arguments
- px
numberPoint x - py
numberPoint y - ax
numberSegment start x - ay
numberSegment start y - bx
numberSegment end x - by
numberSegment end y
Returns
geometry.lines.lineAngle()
Compute the angle formed by the line joining two points (x1, y1) and (x2, y2)
Returns
-
number
geometry.lines.lineIntersection(ax0, ay0, ax1, ay1, bx0, by0, bx1, by1)
Intersection between two lines (unbounded)
Arguments
- ax0
numberThe X coordinate of the start point of the first line. - ay0
numberThe Y coordinate of the start point of the first line. - ax1
numberThe X coordinate of the end point of the first line. - ay1
numberThe Y coordinate of the end point of the first line.v - bx0
numberThe X coordinate of the start point of the second line. - by0
numberThe Y coordinate of the start point of the second line. - bx1
numberThe X coordinate of the end point of the second line. - by1
numberThe Y coordinate of the end point of the second line.
geometry.lines.segmentIntersection(ax0, ay0, ax1, ay1, bx0, by0, bx1, by1)
Intersection between two segments
Arguments
- ax0
numberThe X coordinate of the start point of the first line. - ay0
numberThe Y coordinate of the start point of the first line. - ax1
numberThe X coordinate of the end point of the first line. - ay1
numberThe Y coordinate of the end point of the first line.v - bx0
numberThe X coordinate of the start point of the second line. - by0
numberThe Y coordinate of the start point of the second line. - bx1
numberThe X coordinate of the end point of the second line. - by1
numberThe Y coordinate of the end point of the second line.
geometry.lines.segmentRectangleIntersection(ax, ay, bx, by, minX, minY, maxX, maxY)
Arguments
- ax
Number - ay
Number - bx
Number - by
Number - minX
Number - minY
Number - maxX
Number - maxY
Number
Returns
-
Array<Point>
geometry.lines.twoSegmentsIntersect(p1, p2, p3, p4[, excludeBoundaries])
Indicates if two segments intersect.
Arguments
- p1
PointFirst extremity of the first segment - p2
PointSecond extremity of the first segment - p3
PointFirst extremity of the second segment - p4
PointSecond extremity of the second segment - excludeBoundaries(optional)
boolean[=false]If true, the segment will not be considered as intersecting if the intersection point is one of their extremities
Returns
-
boolean