Skip to content

Commit c4df81b

Browse files
committed
[contrib/geoToolbox] changed atan2 call to atan for lua 5.4 compatibility
1 parent e99827d commit c4df81b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

contrib/geoToolbox.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ local function get_distance(lat1, lon1, ele1, lat2, lon2, ele2)
430430
math.cos(math.rad(lat1)) * math.cos(math.rad(lat2)) *
431431
math.sin(dLon/2) * math.sin(dLon/2)
432432
;
433-
local angle = 2 * math.atan2(math.sqrt(a), math.sqrt(1-a));
433+
local angle = 2 * math.atan(math.sqrt(a), math.sqrt(1-a));
434434
local distance = earthRadius * angle; -- Distance in km
435435

436436
-- Add the elevation to the calculation

0 commit comments

Comments
 (0)