-
Notifications
You must be signed in to change notification settings - Fork 227
Introduce formula for Karney's inverse geodesic method #500
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce formula for Karney's inverse geodesic method #500
Conversation
This method is an integral part of Karney's solution to inverse geodesic problem. It is only invoked for points that lie on the meridian, or are close to it.
This fixes the inaccuracy caused during the calculation of Newton's starting point.
For details, please refer to Eq. (65) in, Geodesics on an ellipsoid of revolution, Charles F.F Karney, https://arxiv.org/abs/1102.1215
Conflicts (resolved): include/boost/geometry/util/math.hpp
…e structure The computed values from inverse method include distance, azimuth, reverse_azimuth, reduced_length, and geodesic_scale.
The compilation is successful with gcc version (7.2.0), but not with version (5.4.1). The accepted tolerance is set to (0.0000001). Currently, all tests are not passing, which indicates an error in the calculation. Additionally, some changes have been made in karney_inverse.hpp
These values are collected from GeodTest which is associated with GeographicLib: https://zenodo.org/record/32156 The conversion to C++ array format is done using this Python script: https://github.com/adl1995/boost-geometry-extra/blob/master/geographiclib-dataset-parse-inverse.py Geodesic scale (M12) is absent from the GeodTest dataset, so it is manually generated using GeographicLib using this C++ script: https://github.com/adl1995/boost-geometry-extra/blob/master/geographicLib-direct-antipodal.cpp
|
@vissarion, @awulkiew - I have resolved the bug which was causing test failures. Since all tests are passing now, please feel free to review the code. |
|
@adl1995 are you willing to answer the above comments so we can merge this piece of code? I am ok with merging if the above comments are somehow addressed. |
|
@vissarion - Sorry for not being responsive on this PR. I will try and address the comments in the coming weeks so this can be merged. |
NaN was previously being used when the angle was greater than 90 deg. Since we now use the maximum angle value [-90, 90] this function is no longer required.
8bab57b to
05ae463
Compare
2bbf930 to
c5b684f
Compare
|
Thanks Adeel for the long effort. NOTE: the operations are accurate (at least all the tests are passing) but I have noticed some performance issues, i.e. it is slower than We could merge now and resolve this issue in a different PR. @awulkiew @barendgehrels what do you think? |
|
@adl1995 Thanks! @vissarion Yes, I'm ok with merging it now. |
The implementation for Karney's inverse method is almost complete. The test cases are similar to Karney's direct method i.e. taken from GeographicLib. However, there a some bugs in the calculation which leads to failure in test cases.
Once those are resolved, you could review the code for any improvements.