Currently I am trying to get the bearing from the first latitude-longitude point to the last.
I have been to the movable-type website and have got my distance to work but my bearing seems to be giving me trouble.
Y = math.sin(dLon_WPM_1) * math.cos(lat2_WPM_1)
X = math.cos(dLat_WPM_1) * math.sin(lat2_WPM_1)
- math.sin(dLat_WPM_1) * math.cos(lat2_WPM_1) * math.cos(dLon_WPM_1)
BRNG = math.deg(math.atan2(Y, X))
I have double checked and triple checked: all the values are the values I think they are.
Thanks for the help!
Where you have
dLat_WPM_1
in the calc for X, try usinglat1_WPM_1
instead.