pub struct RelativeBearing(/* private fields */);Expand description
Bearing clockwise from the ship’s head, in [0°, 360°).
Implementations§
Source§impl RelativeBearing
impl RelativeBearing
Sourcepub const ABEAM_STARBOARD: Self
pub const ABEAM_STARBOARD: Self
Starboard beam.
Sourcepub const ABEAM_PORT: Self
pub const ABEAM_PORT: Self
Port beam.
Sourcepub fn new(degrees: f64) -> Result<Self>
pub fn new(degrees: f64) -> Result<Self>
Relative bearing from a value in [0.0, 360.0]; 360.0 maps to 0.0.
§Errors
KernelError::NotFinite for NaN or infinity;
KernelError::OutOfRange outside [0.0, 360.0].
Sourcepub fn wrap(degrees: f64) -> Result<Self>
pub fn wrap(degrees: f64) -> Result<Self>
Relative bearing from any finite value, normalised into [0.0, 360.0).
§Errors
KernelError::NotFinite for NaN or infinity.
Sourcepub fn signed_degrees(self) -> f64
pub fn signed_degrees(self) -> f64
Signed angle in [-180.0, 180.0); positive starboard, negative port.
Trait Implementations§
Source§impl Clone for RelativeBearing
impl Clone for RelativeBearing
impl Copy for RelativeBearing
Source§impl Debug for RelativeBearing
impl Debug for RelativeBearing
Source§impl Default for RelativeBearing
impl Default for RelativeBearing
Source§impl Display for RelativeBearing
impl Display for RelativeBearing
Source§impl PartialEq for RelativeBearing
impl PartialEq for RelativeBearing
Source§impl PartialOrd for RelativeBearing
impl PartialOrd for RelativeBearing
impl StructuralPartialEq for RelativeBearing
Auto Trait Implementations§
impl Freeze for RelativeBearing
impl RefUnwindSafe for RelativeBearing
impl Send for RelativeBearing
impl Sync for RelativeBearing
impl Unpin for RelativeBearing
impl UnsafeUnpin for RelativeBearing
impl UnwindSafe for RelativeBearing
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