pub struct DMS3d {
pub latitude: DMS,
pub longitude: DMS,
pub altitude: Option<f64>,
}
Expand description
3D D°M’S“ coordinates, comprises a latitude: D°M’S“ angle a longitude: D°M’S“ angle and optionnal altitude
Fields§
§latitude: DMS
Latitude angle in D°M’S“, cardinal is mandatory
longitude: DMS
Longitude angle in D°M’S“, cardinal is mandatory
altitude: Option<f64>
Optionnal altitude / depth
Implementations§
Source§impl DMS3d
impl DMS3d
Sourcepub fn new(
latitude: DMS,
longitude: DMS,
altitude: Option<f64>,
) -> Result<DMS3d, Error>
pub fn new( latitude: DMS, longitude: DMS, altitude: Option<f64>, ) -> Result<DMS3d, Error>
Builds 3D D°M'S"
coordinates
Sourcepub fn with_altitude(&self, altitude: f64) -> DMS3d
pub fn with_altitude(&self, altitude: f64) -> DMS3d
Builds 3D DMS copy with given altitude attribute in meters
,
if altitude data was already present, it gets overwritten
Sourcepub fn with_altitude_feet(&self, altitude: f64) -> DMS3d
pub fn with_altitude_feet(&self, altitude: f64) -> DMS3d
Same as [with_altitude] but quantity is expressed in feet
Sourcepub fn add_altitude(&mut self, altitude: f64)
pub fn add_altitude(&mut self, altitude: f64)
Adds given altitude quantity to self, if altitude was not defined yet, it takes this value
Sourcepub fn add_altitude_feet(&mut self, altitude: f64)
pub fn add_altitude_feet(&mut self, altitude: f64)
Same as [add_altitude] but quantity is expressed in feet
Sourcepub fn from_ddeg_angles(
latitude: f64,
longitude: f64,
altitude: Option<f64>,
) -> DMS3d
pub fn from_ddeg_angles( latitude: f64, longitude: f64, altitude: Option<f64>, ) -> DMS3d
Builds 3D D°M'S"
coordinates from given angles, expressed
in decimal degrees, and an optionnal altitude.
Sourcepub fn from_cartesian(xyz: Point3D) -> DMS3d
pub fn from_cartesian(xyz: Point3D) -> DMS3d
Builds 3D D°M’S“ coordinates from given Cartesian coordinates
Sourcepub fn distance(&self, other: DMS3d) -> f64
pub fn distance(&self, other: DMS3d) -> f64
Returns distance in meters, between Self and given 3D D°M’S“ coordinates
Sourcepub fn azimuth(&self, rhs: Self) -> f64
pub fn azimuth(&self, rhs: Self) -> f64
Returns azimuth angle ɑ, where 0 <= ɑ < 360,
between Self & other 3D D°M’S“ coordinates.
ɑ, being the angle between North Pole & rhs
coordinates
Sourcepub fn to_cartesian(&self) -> Point3D
pub fn to_cartesian(&self) -> Point3D
Converts Self to Cartesian Coordinates (x, y, z). (x = 0, y = 0, z = 0) being Earth center, in Cartesian coordinates.
Sourcepub fn to_europe50(&self) -> Result<DMS3d, Error>
pub fn to_europe50(&self) -> Result<DMS3d, Error>
Converts Self from WGS84 to EU50 Data
Trait Implementations§
impl Copy for DMS3d
impl StructuralPartialEq for DMS3d
Auto Trait Implementations§
impl Freeze for DMS3d
impl RefUnwindSafe for DMS3d
impl Send for DMS3d
impl Sync for DMS3d
impl Unpin for DMS3d
impl UnwindSafe for DMS3d
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more