-
-
Notifications
You must be signed in to change notification settings - Fork 217
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
Lat/Lon from subpoint #182
Comments
The conversion to |
Okay thanks. I'll delete my comment as it's tangential (no pun intended) |
Can confirm the fix from @dieli fixes erroneous longitude values I've been experiencing. |
I've merged the pull request — thanks! |
(I'm not sure why I thought |
Fixes #182: longitude should be forced into the range [–𝜋, 𝜋).
In the function to get lat/lon of a subpoint, the
reverse_terra
function is called. I have looked at the code and think that this could lead wrong values in case thearctan2
function returns a negative value (for lon).lon = (arctan2(y, x) - 15 * DEG2RAD * gast) % tau
Replacing above line with:
lon = (((arctan2(y, x) - 15 * DEG2RAD * gast) + tau / 2.0) % tau) - tau / 2.0
should fix the issue. Output will then be
+/-pi
Am I wrong here?
see dieli#1
The text was updated successfully, but these errors were encountered: