Returns if the given point exists on this line segment or not.
Return true if the points of this line segment equals the points of the other line segment.
Line segment to compare with.
Returns a new Line Segment where p1 and p2 have changed places.
Private
getReturns the point where the given line segments intersect, if such point exists. If the line segments are parallel none is return since the intersect can potentially be many points.
The other line segment.
How the endpoints should be interpreted of the other line segment.
How the endpoints should be interpreted on this line segment.
Returns the point where the given line intersect this line segment, if such point exists. If the line and the line segment are parallel and on the same line, none is returned because there is no one unique point of intersect.
Verifies if the given point is on the line that would be defined by p1 and p2 of this line segment.
The point to verify
Verifies if the given point is on the line segment defined by p1 and p2.
The point to verify
Checks if there is any overlapping point between the two line segments. This is like intersect, but returns a boolean and will also return true if the line segments are parallel and share one or more common points.
Checks if this line segment is parallel to another line segment. Parallel will also hold true if the line segments overlap, or lie on the same axis. I.e. [0,0] -> [1,0] is deemed parallel to [1,0] -> [2,0]
The line segment to do the comparison on.
Returns boolean whether this segment is placed to the right of given point. This is defined as if whether a line segment starting at point p, and going to x = infinity, intersect this line segment. If the point is on the line segment, false is returned,
Point to check if line segemnt is to the right of
Tells us if endpoints should be part of interval or not.
Returns a new Line Segment where p1 equals the new p instead.
Returns new line segment that is like this segment moved.
Static
fromCreates a LineSegment from an array of numbers. The array must be at least 4 elements long and these first 4 values will be used as [x1, y1, x2, y2].
Static
fromCreates a LineSegment from four numbers. The first two being x and y from the start point of the line segment, the last two the x and y value of the end point.
Generated using TypeDoc
A LineSegment is defined by two points, it represents the line between these points.