nav-types
This crate is designed to make it easy to work with positions and vectors that have meaning as geographic entities.
Example
Place this in your Cargo.toml
= "0.5.2"
and use it to calculate vectors and position:
extern crate nav_types;
use WGS84;
let pos_a = WGS84from_degrees_and_meters;
let pos_b = WGS84from_degrees_and_meters;
println!;
All position formats can work with vectors as long as the vectors are defined in some coordinate system.
use ;
let pos_a = WGS84from_degrees_and_meters;
let vec = ENUnew;
let pos_a_10m_up = pos_a + vec;
// Or with `NED` vector
let ned_vec = NEDnew;
let pos_a_10m_up_2 = pos_a + ned_vec;
Note about usage
The source is based on nalgebra and some methods are
only available if importing traits from nalgebra.
Performance
Currently the only way to calculate vectors between latitude and longitude
positions is to convert to ECEF format and calculate the difference there.
This conversion happens behind the scenes and for this reason could be a source
of some surprise. It is therefor advised to try and use ECEF for as long as
possible only converting to and from at the beginning and end.
On my laptop (absolute numbers will differ on different machines, but relative differences should be similar)
)
)
)
)
)
)
)
)
)
)