pub struct Angle(/* private fields */);Expand description
An angular quantity measured in degrees.
Angle is intentionally neutral: it does not assume a normalization range.
Use Angle::normalized_0_360 or Angle::normalized_signed when a
canonical wrap is required.
Implementations§
Source§impl Angle
impl Angle
Sourcepub const fn from_degrees(degrees: f64) -> Self
pub const fn from_degrees(degrees: f64) -> Self
Creates a new angle measured in degrees.
Sourcepub fn from_radians(radians: f64) -> Self
pub fn from_radians(radians: f64) -> Self
Creates a new angle measured in radians.
Sourcepub fn normalized_0_360(self) -> Self
pub fn normalized_0_360(self) -> Self
Returns the angle normalized into the half-open range [0, 360).
Sourcepub fn normalized_signed(self) -> Self
pub fn normalized_signed(self) -> Self
Returns the angle normalized into the signed range [-180, 180).
Trait Implementations§
impl Copy for Angle
Source§impl<'de> Deserialize<'de> for Angle
impl<'de> Deserialize<'de> for Angle
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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