Whole file
geographiclib/geographiclib-python
The author described this change as “Fix bug where a geodesic with lat1 = 0 and lat2 = nan was treated as equatorial (bug found 2021-07-26).”. It counts as a record because the check below fails on the code as it stood at 62fe5d3a1 and passes on 08745ea35, with nothing else changed between the two runs.
Fix saved2021-07-28
Sharing licenceMIT · LICENSE
Change size+1 −1
What the code was meant to do, written into the code itself as a save note
Fix bug where a geodesic with lat1 = 0 and lat2 = nan was treated as equatorial (bug found 2021-07-26).
The change
| 726 | 726 | lat2 = Math.AngRound(Math.LatFix(lat2)) | |
| 727 | 727 | # Swap points so that point with higher (abs) latitude is point 1 | |
| 728 | 728 | # If one latitude is a nan, then it becomes lat1. | |
| 729 | - | swapp = -1 if abs(lat1) < abs(lat2) else 1 | |
| 729 | + | swapp = -1 if abs(lat1) < abs(lat2) or Math.isnan(lat2) else 1 | |
| 730 | 730 | if swapp < 0: | |
| 731 | 731 | lonsign *= -1 | |
| 732 | 732 | lat2, lat1 = lat1, lat2 |
The check that tells the two apart
fail→pass·geographiclib/test/test_geodesic.py::GeodSolveTest::test_GeodSolve94
Check file geographiclib/test/test_geodesic.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.
Origin and history
The code before it62fe5d3a19643ca08661be2a739eb46689af7396
Broken version dated2021-07-14
Modulegeographiclib.geodesic
Units changedGeodesic
Fingerprint5d8cc7d139926824
Checked2026-08-18 by goldset/0.1
Every field above is generated by our program. None of it is written by hand.
Other bugs found in geographiclib/geographiclib-python
- 2025-08-21Fix bug in geodesic inverse solution for very prolate ellipsoids.
- 2022-03-08Add planimeter reverse arctic test to catch transit bug and fix.
- 2019-09-10Implement fix to AddEdge/transitdirect bug in Java, JS, + Python libraries + add test case. (Already done for C++ + C; not necessary for MATLAB + Fortran.)
- 2015-09-23* Fix geodesic inversion so that nan + point on equator or pole returns all nans. Update tests to check this. * Fix bug in gedistance.m in handling equatorial lines.
- 2015-09-17* Create and install geographiclib.js and geographiclib.min.js. * Complete the unit tests for Java and JavaScript packages. * Introduce GeodesicMask.STANDARD into Java package. * Fix bug in normalizat