Skip to content

Commit

Permalink
WPOverlay: fix exit_tangent trigonometry
Browse files Browse the repository at this point in the history
  • Loading branch information
robertlong13 authored and meee1 committed Nov 17, 2023
1 parent 3f21cc1 commit 0ae563d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ExtLibs/Maps/WPOverlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,8 @@ public void CreateOverlay(PointLatLngAlt home, List<Locationwp> 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
Expand Down

0 comments on commit 0ae563d

Please sign in to comment.