georust / geographiclib-rs

A port of geographiclib in Rust.
MIT License
41 stars 9 forks source link

Fix #22 and #23: geodsolve15 and geodsolve26 #34

Closed stonylohr closed 3 years ago

stonylohr commented 3 years ago

Changed _c2 calculation to match cpp approach, addressing a problem for the case for f <= 0. It's tempting to drop eatanhe as a separate function, and simplify the arguments passed, since this is the only place it's used, but I opted to stick closer to Karney's code. Adds geomath::eatanhe.

Interestingly, the previous approach seemed to faithfully match the approach used in Java and Python, which I think pass these tests. This may suggest some subtle math handling difference between C++/Rust and Java/Python (maybe in atanh?), or that I'm overlooking some other nuance. I'm just taking the alternate Karney approach that works for us, rather than digging any deeper into the underlying cause.

bors[bot] commented 3 years ago

Build succeeded: