isPointOnLineSegment2d

isPointOnLineSegment2d()
isPointOnLineSegment2d(point: Point2, p1: Point2, p2: Point2, tolerance: number): boolean

Returns whether the 2-dimensional point point lies on the line segment p1p2.

Parameters

point: Point2

The point to test

p1: Point2

The first endpoint of the line segment

p2: Point2

The second endpoint of the line segment

tolerance: number

If the perpendicular distance of point from the line segment is less than or equal to tolerance, the function will return true.

Returns: boolean