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

Clean up code comments.

parent 657ebcc5
No related branches found
No related tags found
No related merge requests found
...@@ -35,7 +35,7 @@ module Geocoder ...@@ -35,7 +35,7 @@ module Geocoder
end end
## ##
# Calculate bearing between two sets of co-ordinates. # Calculate bearing between two sets of coordinates.
# Returns a number of degrees from due north (clockwise). # Returns a number of degrees from due north (clockwise).
# #
# Based on: http://www.movable-type.co.uk/scripts/latlong.html # Based on: http://www.movable-type.co.uk/scripts/latlong.html
...@@ -45,7 +45,7 @@ module Geocoder ...@@ -45,7 +45,7 @@ module Geocoder
# convert degrees to radians # convert degrees to radians
lat1, lon1, lat2, lon2 = to_radians(lat1, lon1, lat2, lon2) lat1, lon1, lat2, lon2 = to_radians(lat1, lon1, lat2, lon2)
# compute deltas # compute delta
dlon = lon2 - lon1 dlon = lon2 - lon1
y = Math.sin(dlon) * Math.cos(lat2) y = Math.sin(dlon) * Math.cos(lat2)
...@@ -103,7 +103,8 @@ module Geocoder ...@@ -103,7 +103,8 @@ module Geocoder
## ##
# Convert degrees to radians. # Convert degrees to radians.
# If an array is passed, converts each value and returns array. # If an array (or multiple arguments) is passed,
# converts each value and returns array.
# #
def to_radians(*args) def to_radians(*args)
args = args.first if args.first.is_a?(Array) args = args.first if args.first.is_a?(Array)
...@@ -116,7 +117,8 @@ module Geocoder ...@@ -116,7 +117,8 @@ module Geocoder
## ##
# Convert radians to degrees. # Convert radians to degrees.
# If an array is passed, converts each value and returns array. # If an array (or multiple arguments) is passed,
# converts each value and returns array.
# #
def to_degrees(*args) def to_degrees(*args)
args = args.first if args.first.is_a?(Array) args = args.first if args.first.is_a?(Array)
...@@ -128,7 +130,7 @@ module Geocoder ...@@ -128,7 +130,7 @@ module Geocoder
end end
## ##
# Radius of the earth in the given units (:mi or :km). Default is :mi. # Radius of the Earth in the given units (:mi or :km). Default is :mi.
# Values taken from: http://en.wikipedia.org/wiki/Earth_radius # Values taken from: http://en.wikipedia.org/wiki/Earth_radius
# #
def earth_radius(units = :mi) def earth_radius(units = :mi)
......
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