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

public double distance ( Coord other ) { double dx = this . x - other . x ; double dy = this . y - other . y ; return Math . sqrt ( dx * dx + dy * dy ) ; }
returns the distance to another coordinate
