A Rust interface to GeographicLib
A library for solving geodesic problems
Add this to your Cargo.toml
:
toml
[dependencies]
geographiclib = "0.1.0"
```rust use geographiclib::Geodesic; let g = Geodesic::wgs84(); let (lat1, lon1) = (37.87622, -122.23558); // Berkeley, California let (lat2, lon2) = (-9.4047, 147.1597); // Port Moresby, New Guinea let (ddeg, dm, az1, az2) = g.inverse(lat1, lon1, lat2, lon2);
asserteq!(ddeg, 96.39996198449684); // Distance in degrees asserteq!(dm, 10700471.955233702); // Distance in meters asserteq!(az1, -96.91639942294974); // Azimuth at (lat1, lon1) asserteq!(az2, -127.32548874543627); // Azimuth at (lat2, lon2) ```
This version is released under the same license as GeographicLib; MIT/X11 License