Calculates the closest point on a line segment to a given point
Output parameter for the closest point
The point
First endpoint of the segment
Second endpoint of the segment
Calculates the closest point on a line segment to a given point