[−][src]Struct nav_types::WGS84
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]
f64: From<N>,
pub fn from_degrees_and_meters(
latitude: N,
longitude: N,
altitude: N
) -> WGS84<N>
[src]
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_from_degrees_and_meters(
latitude: N,
longitude: N,
altitude: N
) -> Option<WGS84<N>>
[src]
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 from_radians_and_meters(
latitude: N,
longitude: N,
altitude: N
) -> WGS84<N>
[src]
latitude: N,
longitude: N,
altitude: N
) -> WGS84<N>
Create a new WGS84 position
Arguments
latitude
in radianslongitude
in radiansaltitude
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]
latitude: N,
longitude: N,
altitude: N
) -> Option<WGS84<N>>
Try to create a new WGS84 position
Arguments
latitude
in radianslongitude
in radiansaltitude
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]
N: RealField,
T: Into<ENU<N>>,
type Output = WGS84<N>
The resulting type after applying the +
operator.
fn add(self, right: T) -> Self
[src]
impl<N, T> AddAssign<T> for WGS84<N> where
N: RealField + AddAssign,
T: Into<ENU<N>>,
[src]
N: RealField + AddAssign,
T: Into<ENU<N>>,
fn add_assign(&mut self, right: T)
[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]
N: RealField,
T: Into<ENU<N>>,
type Output = WGS84<N>
The resulting type after applying the -
operator.
fn sub(self, right: T) -> WGS84<N>
[src]
impl<N: RealField> 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>
[src]
impl<N, T> SubAssign<T> for WGS84<N> where
N: RealField + SubAssign,
T: Into<ENU<N>>,
[src]
N: RealField + SubAssign,
T: Into<ENU<N>>,
fn sub_assign(&mut self, right: T)
[src]
Auto Trait Implementations
impl<N> RefUnwindSafe for WGS84<N> where
N: RefUnwindSafe,
N: RefUnwindSafe,
impl<N> Send for WGS84<N> where
N: Send,
N: Send,
impl<N> Sync for WGS84<N> where
N: Sync,
N: Sync,
impl<N> Unpin for WGS84<N> where
N: Unpin,
N: Unpin,
impl<N> UnwindSafe for WGS84<N> where
N: UnwindSafe,
N: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, Right> ClosedAdd<Right> for T where
T: Add<Right, Output = T> + AddAssign<Right>,
T: Add<Right, Output = T> + AddAssign<Right>,
impl<T, Right> ClosedSub<Right> for T where
T: Sub<Right, Output = T> + SubAssign<Right>,
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]
U: From<T>,
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]
T: PartialEq<T> + Copy + Any + Debug,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,
pub fn to_subset(&self) -> Option<SS>
pub fn is_in_subset(&self) -> bool
pub fn to_subset_unchecked(&self) -> SS
pub fn from_subset(element: &SS) -> SP
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,