public double distance(Location o){
  return Math.sqrt(distanceSquared(o));
}

public double distance ( Location o ) { return Math . sqrt ( distanceSquared ( o ) ) ; }
get the distance between this location and another . the value of this method is not cached and uses a costly square - root function , so do not repeatedly call this method to get the location ' s magnitude . nan will be returned if the inner result of the sqrt ( ) function overflows , which will be caused if the distance is too long .
