Find the distance between a point and a line segment