pub struct Angle(/* private fields */);Expand description
A type-safe angle that stores radians internally but provides construction and conversion in both radians and degrees.
Implementations§
Source§impl Angle
impl Angle
Sourcepub const fn from_radians(rad: f32) -> Self
pub const fn from_radians(rad: f32) -> Self
Create from radians.
Sourcepub fn from_degrees(deg: f32) -> Self
pub fn from_degrees(deg: f32) -> Self
Create from degrees.
Sourcepub fn as_radians(self) -> f32
pub fn as_radians(self) -> f32
Get the angle in radians.
Sourcepub fn as_degrees(self) -> f32
pub fn as_degrees(self) -> f32
Get the angle in degrees.
Sourcepub fn normalized(self) -> Self
pub fn normalized(self) -> Self
Normalize to the range (-π, π].
Trait Implementations§
Source§impl AddAssign for Angle
impl AddAssign for Angle
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+= operation. Read moreimpl Copy for Angle
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