diff --git a/lib/geocoder.rb b/lib/geocoder.rb index a8c37ae9615f4f98f26b7ac95746f733d2b7c7e0..a68acff510cf5d4ac4e2c8fba4a126731be924f5 100644 --- a/lib/geocoder.rb +++ b/lib/geocoder.rb @@ -2,7 +2,6 @@ # Add geocoding functionality (via Google) to any object. # module Geocoder - include Math ## # Implementation of 'included' hook method. @@ -208,9 +207,9 @@ module Geocoder dlat = (lat1 - lat2).abs dlon = (lon1 - lon2).abs - a = (sin(dlat / 2))**2 + cos(lat1) * - (sin(dlon / 2))**2 * cos(lat2) - c = 2 * atan2( sqrt(a), sqrt(1-a)) + a = (Math.sin(dlat / 2))**2 + Math.cos(lat1) * + (Math.sin(dlon / 2))**2 * Math.cos(lat2) + c = 2 * Math.atan2( Math.sqrt(a), Math.sqrt(1-a)) c * units[options[:units]] end @@ -246,7 +245,7 @@ module Geocoder # Convert degrees to radians. # def self.to_radians(degrees) - degrees * (PI / 180) + degrees * (Math::PI / 180) end ##