Line2D has a ptLineDist(Point2D) method that takes care of the awkwardness involved in the fact that Line2D is a line segment. There's a whole bunch of methods with very similar functionality:...