Struct AngleUnbounded

Source
pub struct AngleUnbounded<F> { /* private fields */ }
Expand description

Represents a point on the circle as a unit-agnostic angle.

The parameter F is the floating-point type used to store the value.

§Behaviour

Unlike Angle, two different values of the same point on the circle are two different AngleUnbounded.

let a = AngleUnbounded::from_degrees(90.0);
let b = AngleUnbounded::from_degrees(450.0);

assert_ne!(a, b);

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 AngleUnbounded<f32>

Source

pub fn to_f64(self) -> AngleUnbounded<f64>

Converts the floating point type to f64.

Source§

impl AngleUnbounded<f64>

Source

pub fn to_f32(self) -> AngleUnbounded<f32>

Converts the floating point type to f32.

Source§

impl<F: FloatMath> AngleUnbounded<F>

Source

pub fn sin(self) -> F

Available on crate features std or libm only.

Computes the sine.

Source

pub fn cos(self) -> F

Available on crate features std or libm only.

Computes the cosine.

Source

pub fn tan(self) -> F

Available on crate features std or libm only.

Computes the tangent.

Source

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

Available on crate features std or libm only.

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

Trait Implementations§

Source§

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

Source§

type Output = <AngleUnbounded<F> as Add>::Output

The resulting type after applying the + operator.
Source§

fn add( self, other: &AngleUnbounded<F>, ) -> <AngleUnbounded<F> as Add<AngleUnbounded<F>>>::Output

Performs the + operation. Read more
Source§

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

Source§

type Output = <AngleUnbounded<F> as Add>::Output

The resulting type after applying the + operator.
Source§

fn add( self, other: &AngleUnbounded<F>, ) -> <AngleUnbounded<F> as Add<AngleUnbounded<F>>>::Output

Performs the + operation. Read more
Source§

impl<'a, F: Float> Add<AngleUnbounded<F>> for &'a AngleUnbounded<F>

Source§

type Output = <AngleUnbounded<F> as Add>::Output

The resulting type after applying the + operator.
Source§

fn add( self, other: AngleUnbounded<F>, ) -> <AngleUnbounded<F> as Add<AngleUnbounded<F>>>::Output

Performs the + operation. Read more
Source§

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

Source§

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: Float> AddAssign<&AngleUnbounded<F>> for AngleUnbounded<F>

Source§

fn add_assign(&mut self, other: &AngleUnbounded<F>)

Performs the += operation. Read more
Source§

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

Source§

fn add_assign(&mut self, rhs: Self)

Performs the += operation. Read more
Source§

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

Source§

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

Returns a duplicate 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<'de, F: Float + Deserialize<'de>> Deserialize<'de> for AngleUnbounded<F>

Available on crate feature serde only.
Source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<F: Float> Distribution<AngleUnbounded<F>> for Standard
where Self: Distribution<Angle<F>>,

Available on crate feature rand only.
Source§

fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> AngleUnbounded<F>

Generate a random value of T, using rng as the source of randomness.
Source§

fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>
where R: Rng, Self: Sized,

Create an iterator that generates random values of T, using rng as the source of randomness. Read more
Source§

fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S>
where F: Fn(T) -> S, Self: Sized,

Create a distribution of values of ‘S’ by mapping the output of Self through the closure F Read more
Source§

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

Source§

type Output = <AngleUnbounded<F> as Div<F>>::Output

The resulting type after applying the / operator.
Source§

fn div(self, other: &F) -> <AngleUnbounded<F> as Div<F>>::Output

Performs the / operation. Read more
Source§

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

Source§

type Output = <AngleUnbounded<F> as Div<F>>::Output

The resulting type after applying the / operator.
Source§

fn div(self, other: &F) -> <AngleUnbounded<F> as Div<F>>::Output

Performs the / operation. Read more
Source§

impl<'a, F: Float> Div<F> for &'a AngleUnbounded<F>

Source§

type Output = <AngleUnbounded<F> as Div<F>>::Output

The resulting type after applying the / operator.
Source§

fn div(self, other: F) -> <AngleUnbounded<F> as Div<F>>::Output

Performs the / operation. Read more
Source§

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

Source§

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: Float> DivAssign<&F> for AngleUnbounded<F>

Source§

fn div_assign(&mut self, other: &F)

Performs the /= operation. Read more
Source§

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

Source§

fn div_assign(&mut self, rhs: F)

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 From<AngleUnbounded<f32>> for AngleUnbounded<f64>

Source§

fn from(value: AngleUnbounded<f32>) -> Self

Converts to this type from the input type.
Source§

impl From<AngleUnbounded<f64>> for AngleUnbounded<f32>

Source§

fn from(value: AngleUnbounded<f64>) -> 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

Source§

type Output = <f32 as Mul<AngleUnbounded<f32>>>::Output

The resulting type after applying the * operator.
Source§

fn mul( self, other: &AngleUnbounded<f32>, ) -> <f32 as Mul<AngleUnbounded<f32>>>::Output

Performs the * operation. Read more
Source§

impl Mul<&AngleUnbounded<f32>> for f32

Source§

type Output = <f32 as Mul<AngleUnbounded<f32>>>::Output

The resulting type after applying the * operator.
Source§

fn mul( self, other: &AngleUnbounded<f32>, ) -> <f32 as Mul<AngleUnbounded<f32>>>::Output

Performs the * operation. Read more
Source§

impl Mul<&AngleUnbounded<f64>> for &f64

Source§

type Output = <f64 as Mul<AngleUnbounded<f64>>>::Output

The resulting type after applying the * operator.
Source§

fn mul( self, other: &AngleUnbounded<f64>, ) -> <f64 as Mul<AngleUnbounded<f64>>>::Output

Performs the * operation. Read more
Source§

impl Mul<&AngleUnbounded<f64>> for f64

Source§

type Output = <f64 as Mul<AngleUnbounded<f64>>>::Output

The resulting type after applying the * operator.
Source§

fn mul( self, other: &AngleUnbounded<f64>, ) -> <f64 as Mul<AngleUnbounded<f64>>>::Output

Performs the * operation. Read more
Source§

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

Source§

type Output = <AngleUnbounded<F> as Mul<F>>::Output

The resulting type after applying the * operator.
Source§

fn mul(self, other: &F) -> <AngleUnbounded<F> as Mul<F>>::Output

Performs the * operation. Read more
Source§

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

Source§

type Output = <AngleUnbounded<F> as Mul<F>>::Output

The resulting type after applying the * operator.
Source§

fn mul(self, other: &F) -> <AngleUnbounded<F> as Mul<F>>::Output

Performs the * operation. Read more
Source§

impl<'a> Mul<AngleUnbounded<f32>> for &'a f32

Source§

type Output = <f32 as Mul<AngleUnbounded<f32>>>::Output

The resulting type after applying the * operator.
Source§

fn mul( self, other: AngleUnbounded<f32>, ) -> <f32 as Mul<AngleUnbounded<f32>>>::Output

Performs the * operation. Read more
Source§

impl Mul<AngleUnbounded<f32>> for f32

Source§

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<'a> Mul<AngleUnbounded<f64>> for &'a f64

Source§

type Output = <f64 as Mul<AngleUnbounded<f64>>>::Output

The resulting type after applying the * operator.
Source§

fn mul( self, other: AngleUnbounded<f64>, ) -> <f64 as Mul<AngleUnbounded<f64>>>::Output

Performs the * operation. Read more
Source§

impl Mul<AngleUnbounded<f64>> for f64

Source§

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<'a, F: Float> Mul<F> for &'a AngleUnbounded<F>

Source§

type Output = <AngleUnbounded<F> as Mul<F>>::Output

The resulting type after applying the * operator.
Source§

fn mul(self, other: F) -> <AngleUnbounded<F> as Mul<F>>::Output

Performs the * operation. Read more
Source§

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

Source§

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> MulAssign<&F> for AngleUnbounded<F>

Source§

fn mul_assign(&mut self, other: &F)

Performs the *= operation. Read more
Source§

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

Source§

fn mul_assign(&mut self, rhs: F)

Performs the *= operation. Read more
Source§

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

Source§

type Output = <AngleUnbounded<F> as Neg>::Output

The resulting type after applying the - operator.
Source§

fn neg(self) -> <AngleUnbounded<F> as Neg>::Output

Performs the unary - operation. Read more
Source§

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

Source§

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 for AngleUnbounded<F>

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<F: PartialOrd> PartialOrd for AngleUnbounded<F>

Source§

fn partial_cmp(&self, other: &AngleUnbounded<F>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<F> SampleUniform for AngleUnbounded<F>
where UniformFloat<F>: UniformSampler<X = F>, F: SampleBorrow<F> + Copy,

Available on crate feature rand only.
Source§

type Sampler = UniformAngleUnbounded<F>

The UniformSampler implementation supporting type X.
Source§

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

Available on crate feature serde only.
Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

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

Source§

type Output = <AngleUnbounded<F> as Sub>::Output

The resulting type after applying the - operator.
Source§

fn sub( self, other: &AngleUnbounded<F>, ) -> <AngleUnbounded<F> as Sub<AngleUnbounded<F>>>::Output

Performs the - operation. Read more
Source§

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

Source§

type Output = <AngleUnbounded<F> as Sub>::Output

The resulting type after applying the - operator.
Source§

fn sub( self, other: &AngleUnbounded<F>, ) -> <AngleUnbounded<F> as Sub<AngleUnbounded<F>>>::Output

Performs the - operation. Read more
Source§

impl<'a, F: Float> Sub<AngleUnbounded<F>> for &'a AngleUnbounded<F>

Source§

type Output = <AngleUnbounded<F> as Sub>::Output

The resulting type after applying the - operator.
Source§

fn sub( self, other: AngleUnbounded<F>, ) -> <AngleUnbounded<F> as Sub<AngleUnbounded<F>>>::Output

Performs the - operation. Read more
Source§

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

Source§

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: Float> SubAssign<&AngleUnbounded<F>> for AngleUnbounded<F>

Source§

fn sub_assign(&mut self, other: &AngleUnbounded<F>)

Performs the -= operation. Read more
Source§

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

Source§

fn sub_assign(&mut self, rhs: Self)

Performs the -= operation. Read more
Source§

impl<F: Sum> Sum for AngleUnbounded<F>

Source§

fn sum<I: Iterator<Item = Self>>(iter: I) -> Self

Takes an iterator and generates Self from the elements by “summing up” the items.
Source§

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

Source§

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

Source§

impl<F> StructuralPartialEq for AngleUnbounded<F>

Auto Trait Implementations§

§

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

§

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 T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

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<Borrowed> SampleBorrow<Borrowed> for Borrowed
where Borrowed: SampleUniform,

Source§

fn borrow(&self) -> &Borrowed

Immutably borrows from an owned value. See Borrow::borrow
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

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 T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,