Skip to content

Commit

Permalink
Fix for #19. Negative latitudes were not iterating due to negative de…
Browse files Browse the repository at this point in the history
…lta.
  • Loading branch information
PaulJohnson committed Dec 31, 2024
1 parent 1d3313e commit 51e24e3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Geodetics/TransverseMercator.hs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ instance (Ellipsoid e) => GridClass (GridTM e) e where

where
GridPoint east' north' _ _ = falseOrigin grid `applyOffset` p
lat' = fst $ Stream.head $ Stream.dropWhile ((> 1e-5) . snd)
lat' = fst $ Stream.head $ Stream.dropWhile ((> 1e-5) . abs . snd)
$ Stream.tail $ Stream.iterate next (latitude $ trueOrigin grid, 1)
where
next (phi, _) = let delta = north' - m grid phi in (phi + delta / aF0, delta)
Expand Down

0 comments on commit 51e24e3

Please sign in to comment.