Skip to content

Instantly share code, notes, and snippets.

View kalelc's full-sized avatar

Andres Colonia kalelc

View GitHub Profile
class Numeric
def to_rad
self * Math::PI / 180
end
end
# http://www.movable-type.co.uk/scripts/latlong.html
# loc1 and loc2 are arrays of [latitude, longitude]
def distance loc1, loc2
lat1, lon1 = loc1