From c4df81bdef8089a10a441007c8b09ee3f35d3909 Mon Sep 17 00:00:00 2001 From: Bill Ferguson Date: Thu, 5 Aug 2021 18:53:05 -0400 Subject: [PATCH] [contrib/geoToolbox] changed atan2 call to atan for lua 5.4 compatibility --- contrib/geoToolbox.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/geoToolbox.lua b/contrib/geoToolbox.lua index c43d313..db99d26 100644 --- a/contrib/geoToolbox.lua +++ b/contrib/geoToolbox.lua @@ -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.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 -- Add the elevation to the calculation