Skip to content

Commit 582d250

Browse files
committed
conversion: Simplified latitude formula in to_latlon()
1 parent 1cbe0fa commit 582d250

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

utm/conversion.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def to_latlon(easting, northing, zone_number, zone_letter):
7070
ep_sin_sqrt = math.sqrt(1 - E * p_sin2)
7171

7272
n = R / ep_sin_sqrt
73-
r = n * (1 - E) / ep_sin
73+
r = (1 - E) / ep_sin
7474

7575
c = _E * p_cos**2
7676
c2 = c * c
@@ -82,7 +82,7 @@ def to_latlon(easting, northing, zone_number, zone_letter):
8282
d5 = d4 * d
8383
d6 = d5 * d
8484

85-
latitude = (p_rad - (n * p_tan / r) *
85+
latitude = (p_rad - (p_tan / r) *
8686
(d2 / 2 -
8787
d4 / 24 * (5 + 3 * p_tan2 + 10 * c - 4 * c2 - 9 * E_P2)) +
8888
d6 / 720 * (61 + 90 * p_tan2 + 298 * c + 45 * p_tan4 - 252 * E_P2 - 3 * c2))

0 commit comments

Comments
 (0)