pub struct Position { /* private fields */ }Expand description
Position on the Earth’s surface (WGS 84).
Implementations§
Source§impl Position
impl Position
Sourcepub const fn new(latitude: Latitude, longitude: Longitude) -> Self
pub const fn new(latitude: Latitude, longitude: Longitude) -> Self
Position from latitude and longitude.
Sourcepub fn from_degrees(latitude: f64, longitude: f64) -> Result<Self>
pub fn from_degrees(latitude: f64, longitude: f64) -> Result<Self>
Sourcepub fn latitude_difference(self, other: Self) -> Angle
pub fn latitude_difference(self, other: Self) -> Angle
Latitude difference to other, north positive.
Sourcepub fn longitude_difference(self, other: Self) -> Angle
pub fn longitude_difference(self, other: Self) -> Angle
Longitude difference to other, east positive, short way.
Sourcepub fn departure(self, other: Self) -> Distance
pub fn departure(self, other: Self) -> Distance
Departure: east-west distance between the meridians at the mean latitude.
Plane-sailing approximation, for short distances.
Sourcepub fn to_geocentric_unit(self) -> GeocentricUnit
pub fn to_geocentric_unit(self) -> GeocentricUnit
Position as a geocentric direction; the form spherical geometry is
computed in. See GeocentricUnit for the axes.
Sourcepub fn from_geocentric_unit(unit: GeocentricUnit) -> Self
pub fn from_geocentric_unit(unit: GeocentricUnit) -> Self
Position of a geocentric direction.
Infallible: the zero vector cannot be a GeocentricUnit.
Trait Implementations§
impl Copy for Position
Source§impl FromStr for Position
impl FromStr for Position
Source§fn from_str(input: &str) -> Result<Self>
fn from_str(input: &str) -> Result<Self>
Parses latitude then longitude.
50°45.3'N 001°17.8'W, N50 45.3 W001 17.8, 50.755, -1.2967.
§Errors
crate::KernelError::Parse if the halves cannot be separated or
either is unreadable.
Source§type Err = KernelError
type Err = KernelError
The associated error which can be returned from parsing.
impl StructuralPartialEq for Position
Auto Trait Implementations§
impl Freeze for Position
impl RefUnwindSafe for Position
impl Send for Position
impl Sync for Position
impl Unpin for Position
impl UnsafeUnpin for Position
impl UnwindSafe for Position
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
Mutably borrows from an owned value. Read more