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

Change variable name.

This reduces the desire to use map! (instead of map) which would modify
the user's argument in-place. There's a test to prevent that but this
makes sense semantically too.
parent 6bef27f7
No related branches found
No related tags found
No related merge requests found
......@@ -118,11 +118,11 @@ module Geocoder
def geographic_center(points)
# convert objects to [lat,lon] arrays and convert degrees to radians
points = points.map{ |p| to_radians(extract_coordinates(p)) }
coords = points.map{ |p| to_radians(extract_coordinates(p)) }
# convert to Cartesian coordinates
x = []; y = []; z = []
points.each do |p|
coords.each do |p|
x << Math.cos(p[0]) * Math.cos(p[1])
y << Math.cos(p[0]) * Math.sin(p[1])
z << Math.sin(p[0])
......
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