Calculates the distance from a point to a line segment
The point to check distance from
Start point of line segment
End point of line segment
Distance from point to line segment
Calculates the distance from a point to a line segment