#[repr(transparent)]
pub struct AngleUnbounded<F> { /* private fields */ }
Expand description

Represents a point on the circle as an 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 different angles :

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: 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> as Add<AngleUnbounded<F>>>::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>

§

type Output = <AngleUnbounded<F> as Add<AngleUnbounded<F>>>::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>

§

type Output = <AngleUnbounded<F> as Add<AngleUnbounded<F>>>::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>

§

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

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 Standardwhere Self: Distribution<Angle<F>>,

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>

§

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>

§

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>

§

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>

§

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

§

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

§

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

§

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

§

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>

§

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>

§

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

§

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

§

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

§

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

§

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>

§

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>

§

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>

§

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>

§

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: PartialOrd> PartialOrd<AngleUnbounded<F>> 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

This method 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

This method 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

This method 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

This method 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,

§

type Sampler = UniformAngleUnbounded<F>

The UniformSampler implementation supporting type X.
source§

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

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>

§

type Output = <AngleUnbounded<F> as Sub<AngleUnbounded<F>>>::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>

§

type Output = <AngleUnbounded<F> as Sub<AngleUnbounded<F>>>::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>

§

type Output = <AngleUnbounded<F> as Sub<AngleUnbounded<F>>>::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>

§

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

source§

fn sub_assign(&mut self, rhs: Self)

Performs the -= operation. Read more
source§

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

source§

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

Method which 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> 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<Borrowed> SampleBorrow<Borrowed> for Borrowedwhere Borrowed: SampleUniform,

source§

fn borrow(&self) -> &Borrowed

Immutably borrows from an owned value. See Borrow::borrow
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.
source§

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