Skip to content
Snippets Groups Projects
Commit 2392cc4c authored by Alex Reisner's avatar Alex Reisner
Browse files

Methods for converting btwn radians and distance.

parent adb31f09
No related branches found
No related tags found
No related merge requests found
...@@ -196,6 +196,14 @@ module Geocoder ...@@ -196,6 +196,14 @@ module Geocoder
end end
end end
def distance_to_radians(distance, units = :mi)
distance.to_f / earth_radius(units)
end
def radians_to_distance(radians, units = :mi)
radians * earth_radius(units)
end
## ##
# Convert miles to kilometers. # Convert miles to kilometers.
# #
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment