pub struct Angle { /* private fields */ }
Expand description
Radian representation of an angle.
§Layout
The Angle
struct is a wrapper around a single f32
value representing the angle in radians:
struct Angle {
float radians;
};
Implementations§
Source§impl Angle
impl Angle
Sourcepub const fn from_radians(radians: f32) -> Self
pub const fn from_radians(radians: f32) -> Self
Returns a new Angle
using the given radians.
Sourcepub const fn from_degrees(degrees: f32) -> Self
pub const fn from_degrees(degrees: f32) -> Self
Returns a new Angle
using the given degrees.
Sourcepub const fn from_turns(turns: f32) -> Self
pub const fn from_turns(turns: f32) -> Self
Returns a new Angle
using the given turns.
Sourcepub const fn from_percentage(percentage: f32) -> Self
pub const fn from_percentage(percentage: f32) -> Self
Returns a new Angle
using the given percentage of a full circle.
Sourcepub const fn as_radians(self) -> f32
pub const fn as_radians(self) -> f32
Returns the angle in radians.
Sourcepub const fn as_degrees(self) -> f32
pub const fn as_degrees(self) -> f32
Returns the angle in degrees.
Sourcepub const fn as_percentage(self) -> f32
pub const fn as_percentage(self) -> f32
Returns the angle as a percentage of a full circle.
Trait Implementations§
Source§impl<'a> AddAssign<&'a Angle> for Angle
impl<'a> AddAssign<&'a Angle> for Angle
Source§fn add_assign(&mut self, other: &'a Angle)
fn add_assign(&mut self, other: &'a Angle)
Performs the
+=
operation. Read moreSource§impl AddAssign for Angle
impl AddAssign for Angle
Source§fn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
Performs the
+=
operation. Read moreSource§impl<'a> DivAssign<&'a Angle> for Angle
impl<'a> DivAssign<&'a Angle> for Angle
Source§fn div_assign(&mut self, other: &'a Angle)
fn div_assign(&mut self, other: &'a Angle)
Performs the
/=
operation. Read moreSource§impl DivAssign for Angle
impl DivAssign for Angle
Source§fn div_assign(&mut self, other: Self)
fn div_assign(&mut self, other: Self)
Performs the
/=
operation. Read moreSource§impl<'a> MulAssign<&'a Angle> for Angle
impl<'a> MulAssign<&'a Angle> for Angle
Source§fn mul_assign(&mut self, other: &'a Angle)
fn mul_assign(&mut self, other: &'a Angle)
Performs the
*=
operation. Read moreSource§impl MulAssign for Angle
impl MulAssign for Angle
Source§fn mul_assign(&mut self, other: Self)
fn mul_assign(&mut self, other: Self)
Performs the
*=
operation. Read moreSource§impl PartialOrd for Angle
impl PartialOrd for Angle
Source§impl<'a> RemAssign<&'a Angle> for Angle
impl<'a> RemAssign<&'a Angle> for Angle
Source§fn rem_assign(&mut self, other: &'a Angle)
fn rem_assign(&mut self, other: &'a Angle)
Performs the
%=
operation. Read moreSource§impl RemAssign for Angle
impl RemAssign for Angle
Source§fn rem_assign(&mut self, other: Self)
fn rem_assign(&mut self, other: Self)
Performs the
%=
operation. Read moreSource§impl<'a> SubAssign<&'a Angle> for Angle
impl<'a> SubAssign<&'a Angle> for Angle
Source§fn sub_assign(&mut self, other: &'a Angle)
fn sub_assign(&mut self, other: &'a Angle)
Performs the
-=
operation. Read moreSource§impl SubAssign for Angle
impl SubAssign for Angle
Source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
Performs the
-=
operation. Read moreimpl Copy 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 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