Struct nav_types::WGS84
[−]
[src]
pub struct WGS84<N> { // some fields omitted }
Geodetic position
This struct represents a position in the geodetic system on the WGS84 ellipsoid. See: WGS84 for more information.
Methods
impl<N: Float> WGS84<N>
[src]
fn new(latitude: N, longitude: N, altitude: N) -> WGS84<N>
Create a new WGS84 position
Arguments
latitude
in degreeslongitude
in degreesaltitude
in meters
Panics
This will panic if latitude
or longitude
are not defined on the
WGS84 ellipsoid.
fn try_new(latitude: N, longitude: N, altitude: N) -> Option<WGS84<N>>
Try to create a new WGS84 position
Arguments
latitude
in degreeslongitude
in degreesaltitude
in meters
fn latitude_degrees(&self) -> N
Get latitude of position, in degrees
fn longitude_degrees(&self) -> N
Get longitude of position, in degrees
fn distance(&self, other: &WGS84<N>) -> N
Distance between two WGS84 positions
This function uses the haversin formula to calculate the distance between two positions. For more control convert to ECEF and calculate the difference.
Examples
use nav_types::WGS84; 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));
impl<N: Copy> WGS84<N>
[src]
fn altitude(&self) -> N
Get altitude of position
fn latitude(&self) -> N
Get latitude in radians
fn longitude(&self) -> N
Get longitude in radians
Trait Implementations
impl<N, T> Add<T> for WGS84<N> where N: Float, T: Into<ENU<N>>
[src]
type Output = WGS84<N>
The resulting type after applying the +
operator
fn add(self, right: T) -> Self
The method for the +
operator
impl<N, T> AddAssign<T> for WGS84<N> where N: Float + AddAssign, T: Into<ENU<N>>
[src]
fn add_assign(&mut self, right: T)
The method for the +=
operator
impl<N, T> Sub<T> for WGS84<N> where N: Float, T: Into<ENU<N>>
[src]
type Output = WGS84<N>
The resulting type after applying the -
operator
fn sub(self, right: T) -> WGS84<N>
The method for the -
operator
impl<N: Float> Sub<WGS84<N>> for WGS84<N>
[src]
type Output = ENU<N>
The resulting type after applying the -
operator
fn sub(self, right: WGS84<N>) -> ENU<N>
The method for the -
operator
impl<N, T> SubAssign<T> for WGS84<N> where N: Float + SubAssign, T: Into<ENU<N>>
[src]
fn sub_assign(&mut self, right: T)
The method for the -=
operator
impl<N: Debug> Debug for WGS84<N>
[src]
impl<N: Copy> Copy for WGS84<N>
[src]
impl<N: Clone> Clone for WGS84<N>
[src]
fn clone(&self) -> WGS84<N>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<N: PartialEq> PartialEq for WGS84<N>
[src]
fn eq(&self, __arg_0: &WGS84<N>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &WGS84<N>) -> bool
This method tests for !=
.