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]
impl<N> WGS84<N> where
N: Float,
pub fn new(latitude: N, longitude: N, altitude: N) -> WGS84<N>
[src]
pub 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.
pub fn try_new(latitude: N, longitude: N, altitude: N) -> Option<WGS84<N>>
[src]
pub 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
pub fn latitude_degrees(&self) -> N
[src]
pub fn latitude_degrees(&self) -> N
Get latitude of position, in degrees
pub fn longitude_degrees(&self) -> N
[src]
pub fn longitude_degrees(&self) -> N
Get longitude of position, in degrees
pub fn distance(&self, other: &WGS84<N>) -> N
[src]
pub 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> WGS84<N> where
N: Copy,
[src]
impl<N> WGS84<N> where
N: Copy,
pub fn altitude(&self) -> N
[src]
pub fn altitude(&self) -> N
Get altitude of position
pub fn latitude(&self) -> N
[src]
pub fn latitude(&self) -> N
Get latitude in radians
pub fn longitude(&self) -> N
[src]
pub 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]
impl<N, T> Add<T> for WGS84<N> where
N: Float,
T: Into<ENU<N>>,
type Output = WGS84<N>
The resulting type after applying the +
operator.
fn add(self, right: T) -> WGS84<N>
[src]
fn add(self, right: T) -> WGS84<N>
Performs the +
operation.
impl<N, T> Sub<T> for WGS84<N> where
N: Float,
T: Into<ENU<N>>,
[src]
impl<N, T> Sub<T> for WGS84<N> where
N: Float,
T: Into<ENU<N>>,
type Output = WGS84<N>
The resulting type after applying the -
operator.
fn sub(self, right: T) -> WGS84<N>
[src]
fn sub(self, right: T) -> WGS84<N>
Performs the -
operation.
impl<N> Sub<WGS84<N>> for WGS84<N> where
N: Float,
[src]
impl<N> Sub<WGS84<N>> for WGS84<N> where
N: Float,
type Output = ENU<N>
The resulting type after applying the -
operator.
fn sub(self, right: WGS84<N>) -> ENU<N>
[src]
fn sub(self, right: WGS84<N>) -> ENU<N>
Performs the -
operation.
impl<N> Clone for WGS84<N> where
N: Clone,
[src]
impl<N> Clone for WGS84<N> where
N: Clone,
fn clone(&self) -> 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[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<N> Debug for WGS84<N> where
N: Debug,
[src]
impl<N> Debug for WGS84<N> where
N: Debug,
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
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]
impl<N, T> SubAssign<T> for WGS84<N> where
N: Float + SubAssign<N>,
T: Into<ENU<N>>,
fn sub_assign(&mut self, right: T)
[src]
fn sub_assign(&mut self, right: T)
Performs the -=
operation.
impl<N> Copy for WGS84<N> where
N: Copy,
[src]
impl<N> Copy for WGS84<N> where
N: Copy,
impl<N> PartialEq<WGS84<N>> for WGS84<N> where
N: PartialEq<N>,
[src]
impl<N> PartialEq<WGS84<N>> for WGS84<N> where
N: PartialEq<N>,
fn eq(&self, other: &WGS84<N>) -> bool
[src]
fn eq(&self, other: &WGS84<N>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &WGS84<N>) -> bool
[src]
fn ne(&self, other: &WGS84<N>) -> bool
This method tests for !=
.
impl<N, T> AddAssign<T> for WGS84<N> where
N: Float + AddAssign<N>,
T: Into<ENU<N>>,
[src]
impl<N, T> AddAssign<T> for WGS84<N> where
N: Float + AddAssign<N>,
T: Into<ENU<N>>,
fn add_assign(&mut self, right: T)
[src]
fn add_assign(&mut self, right: T)
Performs the +=
operation.
impl<N> From<ECEF<N>> for WGS84<N> where
N: Float,
[src]
impl<N> From<ECEF<N>> for WGS84<N> where
N: Float,
impl<N> From<NVector<N>> for WGS84<N> where
N: Float,
[src]
impl<N> From<NVector<N>> for WGS84<N> where
N: Float,
impl<N> From<WGS84<N>> for NVector<N> where
N: Float,
[src]
impl<N> From<WGS84<N>> for NVector<N> where
N: Float,
impl<N> From<WGS84<N>> for ECEF<N> where
N: Float,
[src]
impl<N> From<WGS84<N>> for ECEF<N> where
N: Float,
impl Borrow<WGS84<f64>> for Coordinates
[src]
impl Borrow<WGS84<f64>> for Coordinates
impl AsRef<WGS84<f64>> for Coordinates
[src]
impl AsRef<WGS84<f64>> for Coordinates
impl From<WGS84<f64>> for Coordinates
[src]
impl From<WGS84<f64>> for Coordinates