[][src]Struct nav_types::WGS84

pub struct WGS84<N> { /* fields omitted */ }

Geodetic position

This struct represents a position in the geodetic system on the WGS84 ellipsoid. See: WGS84 for more information. The serde feature allows this to be Serialized / Deserialized. If serialized into json, it will look like this. Enabled thought the serde feature

{
   "latitude": 0.0,
   "longitude": 0.0,
   "altitude": 0.0
}

Note: latitude and longitude values will be in radians

Implementations

impl<N: RealField> WGS84<N> where
    f64: From<N>, 
[src]

pub fn from_degrees_and_meters(
    latitude: N,
    longitude: N,
    altitude: N
) -> WGS84<N>
[src]

Create a new WGS84 position

Arguments

  • latitude in degrees
  • longitude in degrees
  • altitude in meters

Panics

This will panic if latitude or longitude are not defined on the WGS84 ellipsoid.

pub fn try_from_degrees_and_meters(
    latitude: N,
    longitude: N,
    altitude: N
) -> Option<WGS84<N>>
[src]

Try to create a new WGS84 position

Arguments

  • latitude in degrees
  • longitude in degrees
  • altitude in meters

pub fn from_radians_and_meters(
    latitude: N,
    longitude: N,
    altitude: N
) -> WGS84<N>
[src]

Create a new WGS84 position

Arguments

  • latitude in radians
  • longitude in radians
  • altitude in meters

Panics

This will panic if latitude or longitude are not defined on the WGS84 ellipsoid.

pub fn try_from_radians_and_meters(
    latitude: N,
    longitude: N,
    altitude: N
) -> Option<WGS84<N>>
[src]

Try to create a new WGS84 position

Arguments

  • latitude in radians
  • longitude in radians
  • altitude in meters

pub fn latitude_degrees(&self) -> N[src]

Get latitude of position, in degrees

pub fn longitude_degrees(&self) -> N[src]

Get longitude of position, in degrees

pub fn distance(&self, other: &WGS84<N>) -> N[src]

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::from_degrees_and_meters(59.95, 10.75, 0.0);
let stockholm = WGS84::from_degrees_and_meters(59.329444, 18.068611, 0.0);

println!("Great circle distance between Oslo and Stockholm: {:?}",
    oslo.distance(&stockholm));

impl<N: Copy> WGS84<N>[src]

pub fn altitude(&self) -> N[src]

Get altitude of position, in meters

pub fn latitude_radians(&self) -> N[src]

Get latitude of position, in radians

pub fn longitude_radians(&self) -> N[src]

Get longitude of position, in radians

Trait Implementations

impl<N, T> Add<T> for WGS84<N> where
    N: RealField,
    T: Into<ENU<N>>, 
[src]

type Output = WGS84<N>

The resulting type after applying the + operator.

impl<N, T> AddAssign<T> for WGS84<N> where
    N: RealField + AddAssign,
    T: Into<ENU<N>>, 
[src]

impl<N: Clone> Clone for WGS84<N>[src]

impl<N: Copy> Copy for WGS84<N>[src]

impl<N: Debug> Debug for WGS84<N>[src]

impl<N: RealField> From<ECEF<N>> for WGS84<N>[src]

impl<N: RealField> From<NVector<N>> for WGS84<N>[src]

impl<N: RealField> From<WGS84<N>> for ECEF<N>[src]

impl<N: RealField> From<WGS84<N>> for NVector<N>[src]

impl<N: PartialEq> PartialEq<WGS84<N>> for WGS84<N>[src]

impl<N> StructuralPartialEq for WGS84<N>[src]

impl<N, T> Sub<T> for WGS84<N> where
    N: RealField,
    T: Into<ENU<N>>, 
[src]

type Output = WGS84<N>

The resulting type after applying the - operator.

impl<N: RealField> Sub<WGS84<N>> for WGS84<N>[src]

type Output = ENU<N>

The resulting type after applying the - operator.

impl<N, T> SubAssign<T> for WGS84<N> where
    N: RealField + SubAssign,
    T: Into<ENU<N>>, 
[src]

Auto Trait Implementations

impl<N> RefUnwindSafe for WGS84<N> where
    N: RefUnwindSafe

impl<N> Send for WGS84<N> where
    N: Send

impl<N> Sync for WGS84<N> where
    N: Sync

impl<N> Unpin for WGS84<N> where
    N: Unpin

impl<N> UnwindSafe for WGS84<N> where
    N: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, Right> ClosedAdd<Right> for T where
    T: Add<Right, Output = T> + AddAssign<Right>, 

impl<T, Right> ClosedSub<Right> for T where
    T: Sub<Right, Output = T> + SubAssign<Right>, 

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Scalar for T where
    T: PartialEq<T> + Copy + Any + Debug
[src]

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,