Struct cgmath::Rad

source ·
#[repr(C)]
pub struct Rad<S>(pub S);
Expand description

An angle, in radians.

This type is marked as #[repr(C)].

Tuple Fields§

§0: S

Trait Implementations§

source§

impl<'a, 'b, S: BaseFloat> Add<&'a Rad<S>> for &'b Rad<S>

§

type Output = Rad<S>

The resulting type after applying the + operator.
source§

fn add(self, other: &'a Rad<S>) -> Rad<S>

Performs the + operation. Read more
source§

impl<'a, S: BaseFloat> Add<&'a Rad<S>> for Rad<S>

§

type Output = Rad<S>

The resulting type after applying the + operator.
source§

fn add(self, other: &'a Rad<S>) -> Rad<S>

Performs the + operation. Read more
source§

impl<'a, S: BaseFloat> Add<Rad<S>> for &'a Rad<S>

§

type Output = Rad<S>

The resulting type after applying the + operator.
source§

fn add(self, other: Rad<S>) -> Rad<S>

Performs the + operation. Read more
source§

impl<S: BaseFloat> Add<Rad<S>> for Rad<S>

§

type Output = Rad<S>

The resulting type after applying the + operator.
source§

fn add(self, other: Rad<S>) -> Rad<S>

Performs the + operation. Read more
source§

impl<S: BaseFloat + AddAssign<S>> AddAssign<Rad<S>> for Rad<S>

source§

fn add_assign(&mut self, other: Rad<S>)

Performs the += operation. Read more
source§

impl<S: BaseFloat> Angle for Rad<S>

§

type Unitless = S

source§

fn full_turn() -> Rad<S>

A full rotation.
source§

fn sin(self) -> S

Compute the sine of the angle, returning a unitless ratio. Read more
source§

fn cos(self) -> S

Compute the cosine of the angle, returning a unitless ratio. Read more
source§

fn tan(self) -> S

Compute the tangent of the angle, returning a unitless ratio. Read more
source§

fn sin_cos(self) -> (S, S)

Compute the sine and cosine of the angle, returning the result as a pair. Read more
source§

fn asin(a: S) -> Rad<S>

Compute the arcsine of the ratio, returning the resulting angle. Read more
source§

fn acos(a: S) -> Rad<S>

Compute the arccosine of the ratio, returning the resulting angle. Read more
source§

fn atan(a: S) -> Rad<S>

Compute the arctangent of the ratio, returning the resulting angle. Read more
source§

fn atan2(a: S, b: S) -> Rad<S>

source§

fn normalize(self) -> Self

Return the angle, normalized to the range [0, full_turn).
source§

fn opposite(self) -> Self

Return the angle rotated by half a turn.
source§

fn bisect(self, other: Self) -> Self

Returns the interior bisector of the two angles.
source§

fn turn_div_2() -> Self

Half of a full rotation.
source§

fn turn_div_3() -> Self

A third of a full rotation.
source§

fn turn_div_4() -> Self

A quarter of a full rotation.
source§

fn turn_div_6() -> Self

A sixth of a full rotation.
source§

fn csc(self) -> Self::Unitless

Compute the cosecant of the angle. Read more
source§

fn cot(self) -> Self::Unitless

Compute the cotangent of the angle. Read more
source§

fn sec(self) -> Self::Unitless

Compute the secant of the angle. Read more
source§

impl<S: BaseFloat> ApproxEq for Rad<S>

§

type Epsilon = <S as ApproxEq>::Epsilon

Used for specifying relative comparisons.
source§

fn default_epsilon() -> S::Epsilon

The default tolerance to use when testing values that are close together. Read more
source§

fn default_max_relative() -> S::Epsilon

The default relative tolerance for testing values that are far-apart. Read more
source§

fn default_max_ulps() -> u32

The default ULPs to tolerate when testing values that are far-apart. Read more
source§

fn relative_eq( &self, other: &Self, epsilon: S::Epsilon, max_relative: S::Epsilon ) -> bool

A test for equality that uses a relative comparison if the values are far apart.
source§

fn ulps_eq(&self, other: &Self, epsilon: S::Epsilon, max_ulps: u32) -> bool

A test for equality that uses units in the last place (ULP) if the values are far apart.
source§

fn relative_ne( &self, other: &Self, epsilon: Self::Epsilon, max_relative: Self::Epsilon ) -> bool

The inverse of ApproxEq::relative_eq.
source§

fn ulps_ne(&self, other: &Self, epsilon: Self::Epsilon, max_ulps: u32) -> bool

The inverse of ApproxEq::ulps_eq.
source§

impl<S: Clone> Clone for Rad<S>

source§

fn clone(&self) -> Rad<S>

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<S: Debug> Debug for Rad<S>

source§

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

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

impl<'a, 'b, S: BaseFloat> Div<&'a Rad<S>> for &'b Rad<S>

§

type Output = S

The resulting type after applying the / operator.
source§

fn div(self, other: &'a Rad<S>) -> S

Performs the / operation. Read more
source§

impl<'a, S: BaseFloat> Div<&'a Rad<S>> for Rad<S>

§

type Output = S

The resulting type after applying the / operator.
source§

fn div(self, other: &'a Rad<S>) -> S

Performs the / operation. Read more
source§

impl<'a, S: BaseFloat> Div<Rad<S>> for &'a Rad<S>

§

type Output = S

The resulting type after applying the / operator.
source§

fn div(self, other: Rad<S>) -> S

Performs the / operation. Read more
source§

impl<S: BaseFloat> Div<Rad<S>> for Rad<S>

§

type Output = S

The resulting type after applying the / operator.
source§

fn div(self, other: Rad<S>) -> S

Performs the / operation. Read more
source§

impl<'a, S: BaseFloat> Div<S> for &'a Rad<S>

§

type Output = Rad<S>

The resulting type after applying the / operator.
source§

fn div(self, other: S) -> Rad<S>

Performs the / operation. Read more
source§

impl<S: BaseFloat> Div<S> for Rad<S>

§

type Output = Rad<S>

The resulting type after applying the / operator.
source§

fn div(self, other: S) -> Rad<S>

Performs the / operation. Read more
source§

impl<S: BaseFloat + DivAssign<S>> DivAssign<S> for Rad<S>

source§

fn div_assign(&mut self, scalar: S)

Performs the /= operation. Read more
source§

impl<S> From<Deg<S>> for Rad<S>where S: BaseFloat,

source§

fn from(deg: Deg<S>) -> Rad<S>

Converts to this type from the input type.
source§

impl<S> From<Rad<S>> for Deg<S>where S: BaseFloat,

source§

fn from(rad: Rad<S>) -> Deg<S>

Converts to this type from the input type.
source§

impl<'a, S: BaseFloat> Mul<S> for &'a Rad<S>

§

type Output = Rad<S>

The resulting type after applying the * operator.
source§

fn mul(self, other: S) -> Rad<S>

Performs the * operation. Read more
source§

impl<S: BaseFloat> Mul<S> for Rad<S>

§

type Output = Rad<S>

The resulting type after applying the * operator.
source§

fn mul(self, other: S) -> Rad<S>

Performs the * operation. Read more
source§

impl<S: BaseFloat + MulAssign<S>> MulAssign<S> for Rad<S>

source§

fn mul_assign(&mut self, scalar: S)

Performs the *= operation. Read more
source§

impl<'a, S: BaseFloat> Neg for &'a Rad<S>

§

type Output = Rad<S>

The resulting type after applying the - operator.
source§

fn neg(self) -> Rad<S>

Performs the unary - operation. Read more
source§

impl<S: BaseFloat> Neg for Rad<S>

§

type Output = Rad<S>

The resulting type after applying the - operator.
source§

fn neg(self) -> Rad<S>

Performs the unary - operation. Read more
source§

impl<S: PartialEq> PartialEq<Rad<S>> for Rad<S>

source§

fn eq(&self, other: &Rad<S>) -> 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<S: PartialOrd> PartialOrd<Rad<S>> for Rad<S>

source§

fn partial_cmp(&self, other: &Rad<S>) -> 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<S: BaseFloat + SampleRange> Rand for Rad<S>

source§

fn rand<R: Rng>(rng: &mut R) -> Rad<S>

Generates a random instance of this type using the specified source of randomness.
source§

impl<'a, 'b, S: BaseFloat> Rem<&'a Rad<S>> for &'b Rad<S>

§

type Output = Rad<S>

The resulting type after applying the % operator.
source§

fn rem(self, other: &'a Rad<S>) -> Rad<S>

Performs the % operation. Read more
source§

impl<'a, S: BaseFloat> Rem<&'a Rad<S>> for Rad<S>

§

type Output = Rad<S>

The resulting type after applying the % operator.
source§

fn rem(self, other: &'a Rad<S>) -> Rad<S>

Performs the % operation. Read more
source§

impl<'a, S: BaseFloat> Rem<Rad<S>> for &'a Rad<S>

§

type Output = Rad<S>

The resulting type after applying the % operator.
source§

fn rem(self, other: Rad<S>) -> Rad<S>

Performs the % operation. Read more
source§

impl<S: BaseFloat> Rem<Rad<S>> for Rad<S>

§

type Output = Rad<S>

The resulting type after applying the % operator.
source§

fn rem(self, other: Rad<S>) -> Rad<S>

Performs the % operation. Read more
source§

impl<S: BaseFloat + RemAssign<S>> RemAssign<Rad<S>> for Rad<S>

source§

fn rem_assign(&mut self, other: Rad<S>)

Performs the %= operation. Read more
source§

impl<'a, 'b, S: BaseFloat> Sub<&'a Rad<S>> for &'b Rad<S>

§

type Output = Rad<S>

The resulting type after applying the - operator.
source§

fn sub(self, other: &'a Rad<S>) -> Rad<S>

Performs the - operation. Read more
source§

impl<'a, S: BaseFloat> Sub<&'a Rad<S>> for Rad<S>

§

type Output = Rad<S>

The resulting type after applying the - operator.
source§

fn sub(self, other: &'a Rad<S>) -> Rad<S>

Performs the - operation. Read more
source§

impl<'a, S: BaseFloat> Sub<Rad<S>> for &'a Rad<S>

§

type Output = Rad<S>

The resulting type after applying the - operator.
source§

fn sub(self, other: Rad<S>) -> Rad<S>

Performs the - operation. Read more
source§

impl<S: BaseFloat> Sub<Rad<S>> for Rad<S>

§

type Output = Rad<S>

The resulting type after applying the - operator.
source§

fn sub(self, other: Rad<S>) -> Rad<S>

Performs the - operation. Read more
source§

impl<S: BaseFloat + SubAssign<S>> SubAssign<Rad<S>> for Rad<S>

source§

fn sub_assign(&mut self, other: Rad<S>)

Performs the -= operation. Read more
source§

impl<'a, S: 'a + BaseFloat> Sum<&'a Rad<S>> for Rad<S>

source§

fn sum<I: Iterator<Item = &'a Rad<S>>>(iter: I) -> Rad<S>

Method which takes an iterator and generates Self from the elements by “summing up” the items.
source§

impl<S: BaseFloat> Sum<Rad<S>> for Rad<S>

source§

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

Method which takes an iterator and generates Self from the elements by “summing up” the items.
source§

impl<S: BaseFloat> Zero for Rad<S>

source§

fn zero() -> Rad<S>

Returns the additive identity element of Self, 0. Read more
source§

fn is_zero(&self) -> bool

Returns true if self is equal to the additive identity.
source§

fn set_zero(&mut self)

Sets self to the additive identity element of Self, 0.
source§

impl<S: Copy> Copy for Rad<S>

source§

impl<S> StructuralPartialEq for Rad<S>

Auto Trait Implementations§

§

impl<S> RefUnwindSafe for Rad<S>where S: RefUnwindSafe,

§

impl<S> Send for Rad<S>where S: Send,

§

impl<S> Sync for Rad<S>where S: Sync,

§

impl<S> Unpin for Rad<S>where S: Unpin,

§

impl<S> UnwindSafe for Rad<S>where S: 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,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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<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.
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.
source§

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

Performs the conversion.
source§

impl<T, Rhs> NumAssignOps<Rhs> for Twhere T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>,