Struct google_geocoding::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> WGS84<N> where
    N: Float
[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> WGS84<N> where
    N: Copy
[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.

Performs the + operation.

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

The resulting type after applying the - operator.

Performs the - operation.

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

The resulting type after applying the - operator.

Performs the - operation.

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

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

Formats the value using the given formatter. Read more

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

Performs the -= operation.

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

impl<N> PartialEq<WGS84<N>> for WGS84<N> where
    N: PartialEq<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, T> AddAssign<T> for WGS84<N> where
    N: Float + AddAssign<N>,
    T: Into<ENU<N>>, 
[src]

Performs the += operation.

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

Performs the conversion.

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

Performs the conversion.

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

Performs the conversion.

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

Performs the conversion.

impl Borrow<WGS84<f64>> for Coordinates
[src]

Immutably borrows from an owned value. Read more

impl AsRef<WGS84<f64>> for Coordinates
[src]

Performs the conversion.

impl From<WGS84<f64>> for Coordinates
[src]

Performs the conversion.

Auto Trait Implementations

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

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