#[repr(transparent)]pub struct Angle<F> { /* private fields */ }Expand description
Represents the canonical value of an angle.
The value is stored in the range (-π, π].
The parameter F is the floating-point type used to store the value.
Implementations§
source§impl<F: Float> Angle<F>
impl<F: Float> Angle<F>
sourcepub const RAD_FRAC_PI_2: Self = _
pub const RAD_FRAC_PI_2: Self = _
The angle of π/2 radians.
sourcepub const RAD_FRAC_PI_3: Self = _
pub const RAD_FRAC_PI_3: Self = _
The angle of π/3 radians.
sourcepub const RAD_FRAC_PI_4: Self = _
pub const RAD_FRAC_PI_4: Self = _
The angle of π/4 radians.
sourcepub const RAD_FRAC_PI_6: Self = _
pub const RAD_FRAC_PI_6: Self = _
The angle of π/6 radians.
sourcepub const RAD_FRAC_PI_8: Self = _
pub const RAD_FRAC_PI_8: Self = _
The angle of π/8 radians.
source§impl<F> Angle<F>
impl<F> Angle<F>
sourcepub const fn from_radians_unchecked(radians: F) -> Self
pub const fn from_radians_unchecked(radians: F) -> Self
Creates a new angle from a value in radians assuming it is already in
the the range (-π, π].
source§impl<F: Float> Angle<F>
impl<F: Float> Angle<F>
sourcepub fn from_radians(radians: F) -> Self
pub fn from_radians(radians: F) -> Self
Creates a new angle from a value in radians.
sourcepub fn from_degrees(degrees: F) -> Self
pub fn from_degrees(degrees: F) -> Self
Creates a new angle from a value in degrees.
sourcepub fn from_turns(turns: F) -> Self
pub fn from_turns(turns: F) -> Self
Creates a new angle from a value in turns.
sourcepub fn from_gradians(gradians: F) -> Self
pub fn from_gradians(gradians: F) -> Self
Creates a new angle from a value in gradians.
source§impl<F: Copy> Angle<F>
impl<F: Copy> Angle<F>
sourcepub const fn to_radians(self) -> F
pub const fn to_radians(self) -> F
The value of the angle in radians.
source§impl<F: Float> Angle<F>
impl<F: Float> Angle<F>
sourcepub fn to_degrees(self) -> F
pub fn to_degrees(self) -> F
The value of the angle in degrees.
sourcepub fn to_gradians(self) -> F
pub fn to_gradians(self) -> F
The value of the angle in gradians.
source§impl<F: Copy> Angle<F>
impl<F: Copy> Angle<F>
sourcepub const fn to_unbounded(self) -> AngleUnbounded<F>
pub const fn to_unbounded(self) -> AngleUnbounded<F>
Converts this angle into an unbounded angle.
Trait Implementations§
source§impl<F: Float> From<AngleUnbounded<F>> for Angle<F>
impl<F: Float> From<AngleUnbounded<F>> for Angle<F>
source§fn from(angle: AngleUnbounded<F>) -> Self
fn from(angle: AngleUnbounded<F>) -> Self
Converts to this type from the input type.