Skip to content

Commit

Permalink
Update earthlib.py (#186)
Browse files Browse the repository at this point in the history
Fixes #182: longitude should be forced into the range [β€“πœ‹, πœ‹).
  • Loading branch information
dieli authored and brandon-rhodes committed Jul 2, 2018
1 parent abe7aa2 commit 38e0ab6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion skyfield/earthlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def reverse_terra(xyz_au, gast, iterations=3):
x, y, z = xyz_au
R = sqrt(x*x + y*y)

lon = (arctan2(y, x) - 15 * DEG2RAD * gast) % tau
lon = (((arctan2(y, x) - 15 * DEG2RAD * gast) + tau / 2.0) % tau) - tau / 2.0
lat = arctan2(z, R)

a = ERAD / AU_M
Expand Down

0 comments on commit 38e0ab6

Please sign in to comment.