public double distance(Point2D pt){
  final double x_distance=(pt.getX() - x) * (pt.getX() - x);
  final double y_distance=(pt.getY() - y) * (pt.getY() - y);
  return Math.sqrt(x_distance + y_distance);
}

public double distance ( Point2D pt ) { final double x_distance = ( pt . getX ( ) - x ) * ( pt . getX ( ) - x ) ; final double y_distance = ( pt . getY ( ) - y ) * ( pt . getY ( ) - y ) ; return Math . sqrt ( x_distance + y_distance ) ; }
returns the euclidean distance between a specified point and this point .
