-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
Bearings are calculated wrong. The right code should be as follows (according to this formular ):
private double CalculateBearing(Coordinate c1, Coordinate c2)
{
double dLon = Math.Abs(c2.X - c1.X) * Math.PI / 180;
double y = Math.Sin(dLon) * Math.Cos(c2.Y * Math.PI / 180);
double x = Math.Cos(c1.Y * Math.PI / 180) * Math.Sin(c2.Y * Math.PI / 180) -
(Math.Sin(c1.Y * Math.PI / 180) * Math.Cos(c2.Y * Math.PI / 180) * Math.Cos(dLon));
double bearing = Math.Atan2(y, x);
return bearing;
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels