GPSBabel / gpsbabel

GPSBabel: convert, manipulate, and transfer data from GPS programs or GPS receivers. Open Source and supported on MacOS, Windows, Linux, and more. Pointy clicky GUI or a command line version...
https://www.gpsbabel.org
GNU General Public License v2.0
473 stars 126 forks source link

cleanup great circle. #1318

Closed tsteven4 closed 1 month ago

tsteven4 commented 1 month ago

All these changes are semantic, although one deserves some explanation.

Originally the results from heading and heading_true_degrees had opposite signs after allowing for modulo arithemetic. The formulas for heading may have came from https://www.edwilliams.org/avform147.htm#Crs. This reference had a caveat in the introduction:

For the convenience of North Americans I will take North latitudes and West longitudes as positive and South and East negative. The longitude is the opposite of the usual mathematical convention.

It appears that the sign in heading_true_degrees was inverted to make up for this.

As

one can conclude v1 changes sign, v2 is identical, and the return of heading changes sign. Thus no inversion of the sign in heading_true_degrees is needed.

These changes are in agreement with https://www.movable-type.co.uk/scripts/latlong.html which doesn't make the odd assumption about west latitudes.