Struct cgmath::Deg

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

An angle, in degrees.

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

Tuple Fields§

§0: S

Trait Implementations§

source§

impl<S: BaseFloat> AbsDiffEq<Deg<S>> for Deg<S>

§

type Epsilon = <S as AbsDiffEq<S>>::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 abs_diff_eq(&self, other: &Self, epsilon: S::Epsilon) -> bool

A test for equality that uses the absolute difference to compute the approximate equality of two numbers.
source§

fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool

The inverse of AbsDiffEq::abs_diff_eq.
source§

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

§

type Output = Deg<S>

The resulting type after applying the + operator.
source§

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

Performs the + operation. Read more
source§

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

§

type Output = Deg<S>

The resulting type after applying the + operator.
source§

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

Performs the + operation. Read more
source§

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

§

type Output = Deg<S>

The resulting type after applying the + operator.
source§

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

Performs the + operation. Read more
source§

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

§

type Output = Deg<S>

The resulting type after applying the + operator.
source§

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

Performs the + operation. Read more
source§

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

source§

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

Performs the += operation. Read more
source§

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

§

type Unitless = S

source§

fn full_turn() -> Deg<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) -> Deg<S>

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

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

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

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

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

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

source§

fn normalize(self) -> Self

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

fn normalize_signed(self) -> Self

Return the angle, normalized to the range [-turn_div_2, turn_div_2).
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: Bounded> Bounded for Deg<S>

source§

fn min_value() -> Deg<S>

Returns the smallest finite number this type can represent
source§

fn max_value() -> Deg<S>

Returns the largest finite number this type can represent
source§

impl<S: Clone> Clone for Deg<S>

source§

fn clone(&self) -> Deg<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 Deg<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 Deg<S>> for &'b Deg<S>

§

type Output = S

The resulting type after applying the / operator.
source§

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

Performs the / operation. Read more
source§

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

§

type Output = S

The resulting type after applying the / operator.
source§

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

Performs the / operation. Read more
source§

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

§

type Output = S

The resulting type after applying the / operator.
source§

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

Performs the / operation. Read more
source§

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

§

type Output = S

The resulting type after applying the / operator.
source§

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

Performs the / operation. Read more
source§

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

§

type Output = Deg<S>

The resulting type after applying the / operator.
source§

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

Performs the / operation. Read more
source§

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

§

type Output = Deg<S>

The resulting type after applying the / operator.
source§

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

Performs the / operation. Read more
source§

impl<S: BaseFloat + DivAssign<S>> DivAssign<S> for Deg<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 Deg<S>

§

type Output = Deg<S>

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

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

§

type Output = Deg<S>

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

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

source§

fn mul_assign(&mut self, scalar: S)

Performs the *= operation. Read more
source§

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

§

type Output = Deg<S>

The resulting type after applying the - operator.
source§

fn neg(self) -> Deg<S>

Performs the unary - operation. Read more
source§

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

§

type Output = Deg<S>

The resulting type after applying the - operator.
source§

fn neg(self) -> Deg<S>

Performs the unary - operation. Read more
source§

impl<S: PartialEq> PartialEq<Deg<S>> for Deg<S>

source§

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

source§

fn partial_cmp(&self, other: &Deg<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> RelativeEq<Deg<S>> for Deg<S>

source§

fn default_max_relative() -> S::Epsilon

The default relative tolerance for 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 relative_ne( &self, other: &Rhs, epsilon: Self::Epsilon, max_relative: Self::Epsilon ) -> bool

The inverse of RelativeEq::relative_eq.
source§

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

§

type Output = Deg<S>

The resulting type after applying the % operator.
source§

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

Performs the % operation. Read more
source§

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

§

type Output = Deg<S>

The resulting type after applying the % operator.
source§

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

Performs the % operation. Read more
source§

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

§

type Output = Deg<S>

The resulting type after applying the % operator.
source§

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

Performs the % operation. Read more
source§

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

§

type Output = Deg<S>

The resulting type after applying the % operator.
source§

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

Performs the % operation. Read more
source§

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

source§

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

Performs the %= operation. Read more
source§

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

§

type Output = Deg<S>

The resulting type after applying the - operator.
source§

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

Performs the - operation. Read more
source§

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

§

type Output = Deg<S>

The resulting type after applying the - operator.
source§

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

Performs the - operation. Read more
source§

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

§

type Output = Deg<S>

The resulting type after applying the - operator.
source§

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

Performs the - operation. Read more
source§

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

§

type Output = Deg<S>

The resulting type after applying the - operator.
source§

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

Performs the - operation. Read more
source§

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

source§

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

Performs the -= operation. Read more
source§

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

source§

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

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

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

source§

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

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

impl<S: BaseFloat> UlpsEq<Deg<S>> for Deg<S>

source§

fn default_max_ulps() -> u32

The default ULPs to tolerate when testing values that are far-apart. Read more
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 ulps_ne(&self, other: &Rhs, epsilon: Self::Epsilon, max_ulps: u32) -> bool

The inverse of UlpsEq::ulps_eq.
source§

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

source§

fn zero() -> Deg<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 Deg<S>

source§

impl<S> StructuralPartialEq for Deg<S>

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

impl<S> UnwindSafe for Deg<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> LowerBounded for Twhere T: Bounded,

source§

fn min_value() -> T

Returns the smallest finite number this type can represent
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> UpperBounded for Twhere T: Bounded,

source§

fn max_value() -> T

Returns the largest finite number this type can represent
source§

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