powered by
This function checks if a point P is on a segment AB.
isPointOnSeg(xPoint, yPoint, xStart, yStart, xEnd, yEnd)
Logical; whether the point is on the segment.
x coordinate of point P.
y coordinate of point P.
x coordinate of point A.
y coordinate of point A.
x coordinate of point B.
y coordinate of point B.
isPointOnSeg(2, 3, 1, 2, 3, 4) isPointOnSeg(2, 3, 1, 2, 3, 8) isPointOnSeg(4, 5, 1, 2, 3, 4)
Run the code above in your browser using DataLab