def distance_to(location)
      dLat = deg2rad(location.lat - lat)
      dLon = deg2rad((location.lng - lng).abs)

      dPhi = Math.log(Math.tan(deg2rad(location.lat) / 2 + Math::PI / 4) / Math.tan(deg2rad(lat) / 2 + Math::PI / 4));
      q = (dLat.abs > 1e-10) ? dLat/dPhi : Math.cos(deg2rad(lat));

      dLon = 2 * Math::PI - dLon if (dLon > Math::PI) 
      d = Math.sqrt(dLat * dLat + q * q * dLon * dLon); 

      (d * EARTH_RADIUS_KM * 1000).round
    end
def distance_to(location)
      dLat = deg2rad(location.lat - lat)
      dLon = deg2rad((location.lng - lng).abs)

      dPhi = Math.log(Math.tan(deg2rad(location.lat) / 2 + Math::PI / 4) / Math.tan(deg2rad(lat) / 2 + Math::PI / 4));
      q = (dLat.abs > 1e-10) ? dLat/dPhi : Math.cos(deg2rad(lat));

      dLon = 2 * Math::PI - dLon if (dLon > Math::PI) 
      d = Math.sqrt(dLat * dLat + q * q * dLon * dLon); 

      (d * EARTH_RADIUS_KM * 1000).round
    end
:call-seq:
   new(location_object_or_options, *args)

 Creates a new Location which is used by Marker and Path object
 to represent it's locations.

 <tt>:args</tt>: Either a location which responds to lat or lng, or a Hash which has :lat and :lng keys.


 Calculates the distance in meters to given location

 <tt>location</tt>:: Another location which you want the distance to