-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
[H3] Compute destination point from distance and azimuth using planar 3d math #93084
Conversation
Pinging @elastic/es-analytics-geo (Team:Analytics) |
Hi @iverase, I've created a changelog YAML for you. |
|
||
// check for due north/south azimuth | ||
if (az < Constants.EPSILON || Math.abs(az - M_PI) < Constants.EPSILON) { | ||
if (az < Constants.EPSILON) {// due north |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed all this optimisations in LatLng because there seems to never be called during the tests and they actually produce bad results if p1.getLatRad() + distance > Math.PI /2
or p1.getLatRad() - distance < -Math.PI/2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like a good improvement. I was wondering why two new algorithms were added, when only one old one was deleted?
Similarly to what we have done in #91492 we replace the method
geoAzDistanceRads
from using trigonometric maths to use planar 3d math . This results in a more efficient code, for example benchmarking the methodh3ToGeoBoundary
shows an improvement of 25%: