Added functions for finding the closest point on a line or segment to a point.