pub struct Latitude(/* private fields */);Expand description
Latitude in [-90°, 90°], north positive.
Implementations§
Source§impl Latitude
impl Latitude
Sourcepub const NORTH_POLE: Self
pub const NORTH_POLE: Self
The north pole.
Sourcepub const SOUTH_POLE: Self
pub const SOUTH_POLE: Self
The south pole.
Sourcepub fn from_degrees(value: f64) -> Result<Self>
pub fn from_degrees(value: f64) -> Result<Self>
Latitude from decimal degrees, north positive.
§Errors
crate::KernelError::NotFinite for NaN or infinity;
crate::KernelError::OutOfRange outside [-90.0, 90.0].
Sourcepub fn from_degrees_minutes(
degrees: u16,
minutes: f64,
hemisphere: NorthSouth,
) -> Result<Self>
pub fn from_degrees_minutes( degrees: u16, minutes: f64, hemisphere: NorthSouth, ) -> Result<Self>
Latitude from whole degrees and decimal minutes.
§Errors
As Latitude::from_degrees, after combining.
Sourcepub fn hemisphere(self) -> NorthSouth
pub fn hemisphere(self) -> NorthSouth
Hemisphere; the equator counts as north.
Sourcepub fn to_degrees_minutes(self) -> (u16, f64, NorthSouth)
pub fn to_degrees_minutes(self) -> (u16, f64, NorthSouth)
Whole degrees, decimal minutes and hemisphere.
Sourcepub fn meridional_parts(self) -> Result<f64>
pub fn meridional_parts(self) -> Result<f64>
Meridional parts: Mercator y-coordinate in minutes of arc, on the WGS 84 ellipsoid.
At 45° it gives 3013.6 (a sphere gives 3029.9).
kinavis::sailings::rhumb_line uses a spherical model and will not
match a Mercator sailing computed from these values exactly; use
kinavis::sailings::geodesic when the ellipsoid matters.
§Errors
crate::KernelError::Indeterminate at a pole (infinite).
Sourcepub fn isometric_minutes(self) -> f64
pub fn isometric_minutes(self) -> f64
Spherical isometric latitude, minutes of arc.
The Mercator y-coordinate on a sphere, used by the rhumb-line sailings
in kinavis::sailings. Infinite at the poles.
Trait Implementations§
impl Copy for Latitude
Source§impl FromStr for Latitude
impl FromStr for Latitude
Source§fn from_str(input: &str) -> Result<Self>
fn from_str(input: &str) -> Result<Self>
Parses 50°45.3'N, N50 45 18, -33.9 etc.
Hemisphere letter or sign, not both. See crate::position for
accepted forms.
§Errors
crate::KernelError::Parse for unreadable input or a non-N/S
hemisphere; crate::KernelError::OutOfRange beyond the poles.