pub struct Angle(/* private fields */);Expand description
A plain angular magnitude, in degrees.
Unlike crate::Direction this is not a compass direction and is not wrapped
into [0°, 360°): it is a difference, an error, or a subtended angle, and its
sign carries meaning. Use it for gyro error, sextant angles, leeway and the
like.
Implementations§
Source§impl Angle
impl Angle
Sourcepub fn from_degrees(value: f64) -> Result<Self>
pub fn from_degrees(value: f64) -> Result<Self>
Sourcepub fn from_minutes(value: f64) -> Result<Self>
pub fn from_minutes(value: f64) -> Result<Self>
Creates an angle from minutes of arc.
§Errors
Returns NavigationError::NotFinite for NaN or an infinity.
Sourcepub fn from_degrees_minutes_seconds(
degrees: f64,
minutes: f64,
seconds: f64,
) -> Result<Self>
pub fn from_degrees_minutes_seconds( degrees: f64, minutes: f64, seconds: f64, ) -> Result<Self>
Creates an angle from degrees, minutes and seconds of arc.
§Errors
Returns NavigationError::NotFinite for NaN or an infinity.
Sourcepub fn from_radians(value: f64) -> Result<Self>
pub fn from_radians(value: f64) -> Result<Self>
Sourcepub fn normalised(self) -> Self
pub fn normalised(self) -> Self
The angle folded into [-180°, 180°).
Trait Implementations§
impl Copy for Angle
Source§impl FromStr for Angle
impl FromStr for Angle
Source§fn from_str(input: &str) -> Result<Self>
fn from_str(input: &str) -> Result<Self>
Reads 1°30.5', 1 30 30, -2.7 and the like.
An angle has no hemisphere, so only a sign is accepted.
§Errors
Returns NavigationError::Parse for anything unreadable, including a
hemisphere letter.
Source§type Err = NavigationError
type Err = NavigationError
The associated error which can be returned from parsing.
Source§impl PartialOrd for Angle
impl PartialOrd for Angle
impl StructuralPartialEq for Angle
Auto Trait Implementations§
impl Freeze for Angle
impl RefUnwindSafe for Angle
impl Send for Angle
impl Sync for Angle
impl Unpin for Angle
impl UnsafeUnpin for Angle
impl UnwindSafe for Angle
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