Struct angulus::AngleUnbounded
source · #[repr(transparent)]pub struct AngleUnbounded<F> { /* private fields */ }Expand description
Represents an angle that may not be the canonical value.
The value of this angle is not bound into a range, unlike Angle.
let angle = (3.0_f32 * 90.0_f32.deg()).to_degrees();
let unbounded = (3.0_f32 * 90.0_f32.deg_unbounded()).to_degrees();
assert_float_eq!(angle, -90.0, ulps <= 1);
assert_float_eq!(unbounded, 270.0, ulps <= 1);The parameter F is the floating-point type used to store the value.
Implementations§
source§impl<F: Float> AngleUnbounded<F>
impl<F: Float> AngleUnbounded<F>
sourcepub const EPSILON: Self = _
pub const EPSILON: Self = _
Machine epsilon value for AngleUnbounded.
source§impl<F: Float> AngleUnbounded<F>
impl<F: Float> AngleUnbounded<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: Float> AngleUnbounded<F>
impl<F: Float> AngleUnbounded<F>
source§impl<F: Float> AngleUnbounded<F>
impl<F: Float> AngleUnbounded<F>
source§impl<F: Float> AngleUnbounded<F>
impl<F: Float> AngleUnbounded<F>
source§impl<F> AngleUnbounded<F>
impl<F> AngleUnbounded<F>
sourcepub const fn from_radians(radians: F) -> Self
pub const fn from_radians(radians: F) -> Self
Creates a new unbounded angle from a value in radians.
source§impl<F: Float> AngleUnbounded<F>
impl<F: Float> AngleUnbounded<F>
sourcepub fn from_degrees(degrees: F) -> Self
pub fn from_degrees(degrees: F) -> Self
Creates a new unbounded angle from a value in degrees.
sourcepub fn from_turns(turns: F) -> Self
pub fn from_turns(turns: F) -> Self
Creates a new unbounded angle from a value in turns.
sourcepub fn from_gradians(gradians: F) -> Self
pub fn from_gradians(gradians: F) -> Self
Creates a new unbounded angle from a value in gradians.
source§impl<F: Copy> AngleUnbounded<F>
impl<F: Copy> AngleUnbounded<F>
sourcepub const fn to_radians(self) -> F
pub const fn to_radians(self) -> F
The value of the unbounded angle in radians.
source§impl<F: Float> AngleUnbounded<F>
impl<F: Float> AngleUnbounded<F>
sourcepub fn to_degrees(self) -> F
pub fn to_degrees(self) -> F
The value of the unbounded angle in degrees.
sourcepub fn to_gradians(self) -> F
pub fn to_gradians(self) -> F
The value of the unbounded angle in gradians.
source§impl<F: Float> AngleUnbounded<F>
impl<F: Float> AngleUnbounded<F>
sourcepub fn to_bounded(self) -> Angle<F>
pub fn to_bounded(self) -> Angle<F>
Converts this angle into a bounded angle.
Trait Implementations§
source§impl<F: Float> Add<AngleUnbounded<F>> for AngleUnbounded<F>
impl<F: Float> Add<AngleUnbounded<F>> for AngleUnbounded<F>
source§impl<F: Clone> Clone for AngleUnbounded<F>
impl<F: Clone> Clone for AngleUnbounded<F>
source§fn clone(&self) -> AngleUnbounded<F>
fn clone(&self) -> AngleUnbounded<F>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl<F: Debug> Debug for AngleUnbounded<F>
impl<F: Debug> Debug for AngleUnbounded<F>
source§impl<F: Float> Default for AngleUnbounded<F>
impl<F: Float> Default for AngleUnbounded<F>
source§impl<F: Float> Div<F> for AngleUnbounded<F>
impl<F: Float> Div<F> for AngleUnbounded<F>
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.
source§impl<F: Hash> Hash for AngleUnbounded<F>
impl<F: Hash> Hash for AngleUnbounded<F>
source§impl<F: Float> Mul<F> for AngleUnbounded<F>
impl<F: Float> Mul<F> for AngleUnbounded<F>
source§impl<F: Float> Neg for AngleUnbounded<F>
impl<F: Float> Neg for AngleUnbounded<F>
source§impl<F: PartialEq> PartialEq<AngleUnbounded<F>> for AngleUnbounded<F>
impl<F: PartialEq> PartialEq<AngleUnbounded<F>> for AngleUnbounded<F>
source§fn eq(&self, other: &AngleUnbounded<F>) -> bool
fn eq(&self, other: &AngleUnbounded<F>) -> bool
This method tests for
self and other values to be equal, and is used
by ==.