Struct nav_types::WGS84 [] [src]

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.

Methods

impl<N: Float> 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.

Try to create a new WGS84 position

Arguments

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

Get latitude of position, in degrees

Get longitude of position, in degrees

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]

Get altitude of position

Get latitude in radians

Get longitude in radians

Trait Implementations

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

The resulting type after applying the + operator

The method for the + operator

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

The method for the += operator

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

The resulting type after applying the - operator

The method for the - operator

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

The resulting type after applying the - operator

The method for the - operator

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

The method for the -= operator

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

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

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

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

Formats the value using the given formatter.

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

Performs the conversion.

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

Performs the conversion.