Skip to content

savage13/geographiclib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GeographicLib

Documentation

A Rust interface to GeographicLib

A library for solving geodesic problems

Usage

Add this to your Cargo.toml:

[dependencies]
geographiclib = "0.1.0"

Example

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 (d_deg, d_m, az1, az2) = g.inverse(lat1, lon1, lat2, lon2);

assert_eq!(d_deg, 96.39996198449684); // Distance in degrees
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)

License

This version is released under the same license as GeographicLib; MIT/X11 License

About

A library for solving geodesic problems

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published