Crate nav_types [−] [src]
Easily work with global positions and vectors.
This crate is intended to allow easy and safe interoperability between different global position and vectors in different coordinate systems. The create is built on top of nalgebra and strives to be compatible with types from that crate.
Example
use nav_types::ECEF; use nav_types::ENU; use nav_types::NED; use nav_types::WGS84; // Define positions using latitude and longitude on the WGS84 ellipsoid let oslo = WGS84::new(59.95, 10.75, 0.0); let stockholm = WGS84::new(59.329444, 18.068611, 0.0); println!("Great circle distance between Oslo and Stockholm: {:?}", oslo.distance(&stockholm)); // Calculate vectors between positions let vec = ECEF::from(stockholm) - ECEF::from(oslo); println!("Vector between Oslo and Stockholm: {:?}", vec); // Easily convert between ENU and NED vectors let ned_vec = NED::from(vec); // Add vectors to positions let stockholm_2 = ECEF::from(oslo) + vec + ENU::new(0.0, 10.0, 0.0);
Structs
ECEF |
Earth Centered Earth Fixed position |
ENU |
East North Up vector |
NED |
North East Down vector |
NVector |
N-Vector position |
WGS84 |
Geodetic position |