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

public double distance ( Coordinate c ) { double dx = x - c . x ; double dy = y - c . y ; return Math . sqrt ( dx * dx + dy * dy ) ; }
computes the 2 - dimensional euclidean distance to another location . the z - ordinate is ignored .
