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>

source

pub const ZERO: Self = _

The angle of value zero.

source

pub const EPSILON: Self = _

source§

impl<F: Float> AngleUnbounded<F>

source

pub const RAD_PI: Self = _

The angle of π radians.

source

pub const RAD_FRAC_PI_2: Self = _

The angle of π/2 radians.

source

pub const RAD_FRAC_PI_3: Self = _

The angle of π/3 radians.

source

pub const RAD_FRAC_PI_4: Self = _

The angle of π/4 radians.

source

pub const RAD_FRAC_PI_6: Self = _

The angle of π/6 radians.

source

pub const RAD_FRAC_PI_8: Self = _

The angle of π/8 radians.

source§

impl<F: Float> AngleUnbounded<F>

source

pub const DEG_180: Self = Self::RAD_PI

The angle of 180°.

source

pub const DEG_90: Self = Self::RAD_FRAC_PI_2

The angle of 90°.

source

pub const DEG_60: Self = Self::RAD_FRAC_PI_3

The angle of 60°.

source

pub const DEG_45: Self = Self::RAD_FRAC_PI_4

The angle of 45°.

source

pub const DEG_30: Self = Self::RAD_FRAC_PI_6

The angle of 30°.

source

pub const DEG_22_5: Self = Self::RAD_FRAC_PI_8

The angle of 22.5°.

source§

impl<F: Float> AngleUnbounded<F>

source

pub const HALF: Self = Self::RAD_PI

The angle of a half of a circle (1/2 turns).

source

pub const QUARTER: Self = Self::RAD_FRAC_PI_2

The angle of a quarter of a circle (1/4 turns).

source

pub const SIXTH: Self = Self::RAD_FRAC_PI_3

The angle of a sixth of a circle (1/6 turns).

source

pub const EIGHTH: Self = Self::RAD_FRAC_PI_4

The angle of a eighth of a circle (1/8 turns).

source

pub const TWELFTH: Self = Self::RAD_FRAC_PI_6

The angle of a twelfth of a circle (1/12 turns).

source

pub const SIXTEENTH: Self = Self::RAD_FRAC_PI_8

The angle of a sixteenth of a circle (1/16 turns).

source§

impl<F: Float> AngleUnbounded<F>

source

pub const GRAD_200: Self = Self::RAD_PI

The angle of 200g.

source

pub const GRAD_100: Self = Self::RAD_FRAC_PI_2

The angle of 100g.

source

pub const GRAD_66_6: Self = Self::RAD_FRAC_PI_3

The angle of 66.6g.

source

pub const GRAD_50: Self = Self::RAD_FRAC_PI_4

The angle of 50g.

source

pub const GRAD_33_3: Self = Self::RAD_FRAC_PI_6

The angle of 33.3g.

source

pub const GRAD_25: Self = Self::RAD_FRAC_PI_8

The angle of 25g.

source§

impl<F> AngleUnbounded<F>

source

pub const fn from_radians(radians: F) -> Self

Creates a new unbounded angle from a value in radians.

source§

impl<F: Float> AngleUnbounded<F>

source

pub fn from_degrees(degrees: F) -> Self

Creates a new unbounded angle from a value in degrees.

source

pub fn from_turns(turns: F) -> Self

Creates a new unbounded angle from a value in turns.

source

pub fn from_gradians(gradians: F) -> Self

Creates a new unbounded angle from a value in gradians.

source§

impl<F: Copy> AngleUnbounded<F>

source

pub const fn to_radians(self) -> F

The value of the unbounded angle in radians.

source§

impl<F: Float> AngleUnbounded<F>

source

pub fn to_degrees(self) -> F

The value of the unbounded angle in degrees.

source

pub fn to_turns(self) -> F

The value of the unbounded angle in turns.

source

pub fn to_gradians(self) -> F

The value of the unbounded angle in gradians.

source§

impl<F: Float> AngleUnbounded<F>

source

pub fn to_bounded(self) -> Angle<F>

Converts this angle into a bounded angle.

source§

impl<F: Float> AngleUnbounded<F>

source

pub fn sin(self) -> F

Computes the sine.

source

pub fn cos(self) -> F

Computes the cosine.

source

pub fn tan(self) -> F

Computes the tangent.

source

pub fn sin_cos(self) -> (F, F)

Simultaneously computes the sine and cosine. Returns (sin(x), cos(x)).

Trait Implementations§

source§

impl<F: Float> Add<AngleUnbounded<F>> for AngleUnbounded<F>

§

type Output = AngleUnbounded<F>

The resulting type after applying the + operator.
source§

fn add(self, rhs: Self) -> Self::Output

Performs the + operation. Read more
source§

impl<F: Clone> Clone for AngleUnbounded<F>

source§

fn clone(&self) -> AngleUnbounded<F>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<F: Debug> Debug for AngleUnbounded<F>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<F: Float> Default for AngleUnbounded<F>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<F: Float> Div<F> for AngleUnbounded<F>

§

type Output = AngleUnbounded<F>

The resulting type after applying the / operator.
source§

fn div(self, rhs: F) -> Self::Output

Performs the / operation. Read more
source§

impl<F: Copy> From<Angle<F>> for AngleUnbounded<F>

source§

fn from(angle: Angle<F>) -> Self

Converts to this type from the input type.
source§

impl<F: Float> From<AngleUnbounded<F>> for Angle<F>

source§

fn from(angle: AngleUnbounded<F>) -> Self

Converts to this type from the input type.
source§

impl<F: Hash> Hash for AngleUnbounded<F>

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where
    H: Hasher,
    Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Mul<AngleUnbounded<f32>> for f32

§

type Output = AngleUnbounded<f32>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: AngleUnbounded<f32>) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<AngleUnbounded<f64>> for f64

§

type Output = AngleUnbounded<f64>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: AngleUnbounded<f64>) -> Self::Output

Performs the * operation. Read more
source§

impl<F: Float> Mul<F> for AngleUnbounded<F>

§

type Output = AngleUnbounded<F>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: F) -> Self::Output

Performs the * operation. Read more
source§

impl<F: Float> Neg for AngleUnbounded<F>

§

type Output = AngleUnbounded<F>

The resulting type after applying the - operator.
source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
source§

impl<F: PartialEq> PartialEq<AngleUnbounded<F>> for AngleUnbounded<F>

source§

fn eq(&self, other: &AngleUnbounded<F>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<F: Float> Sub<AngleUnbounded<F>> for AngleUnbounded<F>

§

type Output = AngleUnbounded<F>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Self) -> Self::Output

Performs the - operation. Read more
source§

impl<F: Copy> Copy for AngleUnbounded<F>

source§

impl<F: Eq> Eq for AngleUnbounded<F>

source§

impl<F> StructuralEq for AngleUnbounded<F>

source§

impl<F> StructuralPartialEq for AngleUnbounded<F>

Auto Trait Implementations§

§

impl<F> RefUnwindSafe for AngleUnbounded<F>where
    F: RefUnwindSafe,

§

impl<F> Send for AngleUnbounded<F>where
    F: Send,

§

impl<F> Sync for AngleUnbounded<F>where
    F: Sync,

§

impl<F> Unpin for AngleUnbounded<F>where
    F: Unpin,

§

impl<F> UnwindSafe for AngleUnbounded<F>where
    F: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere
    T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere
    T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere
    T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere
    U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere
    T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere
    U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere
    U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.