Merge pull request #355 from wpferguson/fix_geoToolbox
geoToolbox 5.4 compatibility
This commit is contained in:
@@ -430,7 +430,7 @@ local function get_distance(lat1, lon1, ele1, lat2, lon2, ele2)
|
|||||||
math.cos(math.rad(lat1)) * math.cos(math.rad(lat2)) *
|
math.cos(math.rad(lat1)) * math.cos(math.rad(lat2)) *
|
||||||
math.sin(dLon/2) * math.sin(dLon/2)
|
math.sin(dLon/2) * math.sin(dLon/2)
|
||||||
;
|
;
|
||||||
local angle = 2 * math.atan2(math.sqrt(a), math.sqrt(1-a));
|
local angle = 2 * math.atan(math.sqrt(a), math.sqrt(1-a));
|
||||||
local distance = earthRadius * angle; -- Distance in km
|
local distance = earthRadius * angle; -- Distance in km
|
||||||
|
|
||||||
-- Add the elevation to the calculation
|
-- Add the elevation to the calculation
|
||||||
|
|||||||
Reference in New Issue
Block a user