public double distance(double x,double y){
  double dx=this.x - x;
  double dy=this.y - y;
  return Math.sqrt(dx * dx + dy * dy);
}

public double distance ( double x , double y ) { double dx = this . x - x ; double dy = this . y - y ; return Math . sqrt ( dx * dx + dy * dy ) ; }
returns the distance from this point to the given point .
