From 0ae563dead6cc1b3353a4b5a3a9d4a7eee1527cb Mon Sep 17 00:00:00 2001 From: Bob Long Date: Wed, 15 Nov 2023 09:58:50 +1100 Subject: [PATCH] WPOverlay: fix exit_tangent trigonometry --- ExtLibs/Maps/WPOverlay.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ExtLibs/Maps/WPOverlay.cs b/ExtLibs/Maps/WPOverlay.cs index 93c8de95fe..125256288f 100644 --- a/ExtLibs/Maps/WPOverlay.cs +++ b/ExtLibs/Maps/WPOverlay.cs @@ -193,7 +193,8 @@ public void CreateOverlay(PointLatLngAlt home, List missionitems, do if (dist > this_loiterradius) { route.Add(pointlist[pointlist.Count - 1]); - var offset = from.newpos(bearing - loiterdirection*90, this_loiterradius); + var theta = Math.Acos(this_loiterradius / dist) * MathHelper.rad2deg; + var offset = from.newpos(bearing - loiterdirection*theta, this_loiterradius); route.Add(offset); } else