public static double ptSegDist(double x1,double y1,double x2,double y2,double px,double py){
  return Math.sqrt(ptSegDistSq(x1,y1,x2,y2,px,py));
}

public static double ptSegDist ( double x1 , double y1 , double x2 , double y2 , double px , double py ) { return Math . sqrt ( ptSegDistSq ( x1 , y1 , x2 , y2 , px , py ) ) ; }
returns the distance from a point to a line segment . the distance measured is the distance between the specified point and the closest point between the specified end points . if the specified point intersects the line segment in between the end points , this method returns 0 . 0 .
