From 686e5ba11910bcb17485de23123d8019ce9e9756 Mon Sep 17 00:00:00 2001 From: Alex Reisner <alex@alexreisner.com> Date: Tue, 3 Nov 2009 17:11:56 -0500 Subject: [PATCH] Revert "Include Math module." This reverts commit fc0b5ba901231d41d1dc89de47ef17d1feda8966. --- lib/geocoder.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/geocoder.rb b/lib/geocoder.rb index a8c37ae9..a68acff5 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 ## -- GitLab