Expand description
Rust interface for geodesic calculation from GeographicLib This is the original implementation in C with a Rust interface and inspired from the geographiclib rust project
This is only a part of the geographiclib implementation needed by proj4rs for implementing some projections.
Example
use proj4rs_geodesic::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 (d_m, az1, az2) = g.inverse(lat1, lon1, lat2, lon2);
assert_eq!(d_m, 10700471.955233702); // Distance in meters
assert_eq!(az1, -96.91639942294974); // Azimuth at (lat1, lon1)
assert_eq!(az2, -127.32548874543627); // Azimuth at (lat2, lon2)Note: this is an alternative to the Vincenty distance calculation.
Structsยง
- Geodesic
- Ellipsoid on which Geodesic Calculations are computed