diff --git a/lib/geo.js b/lib/geo.js index 71334af7..998ed933 100644 --- a/lib/geo.js +++ b/lib/geo.js @@ -254,8 +254,8 @@ function geoDistance(x1, y1, x2, y2, options) { return Math.pow(Math.sin(a / 2.0), 2) } - var c = Math.sqrt(haversine(x2 - x1) + Math.cos(x2) * Math.cos(x1) * haversine(y2 - y1)); + var f = Math.sqrt(haversine(x2 - x1) + Math.cos(x2) * Math.cos(x1) * haversine(y2 - y1)); - return 2 * Math.asin(c) * EARTH_RADIUS[type]; + return 2 * Math.asin(f) * EARTH_RADIUS[type]; }