Find the distance from the point to the line segment