Struct cgmath::Deg

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

An angle, in degrees.

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

Tuple Fields§

§0: S

Trait Implementations§

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 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 Deg<S>

§

type Epsilon = S

source§

fn approx_eq_eps(&self, other: &Deg<S>, epsilon: &S) -> bool

source§

fn approx_epsilon() -> Self::Epsilon

source§

fn approx_eq(&self, other: &Self) -> bool

source§

impl<S: Clone + Copy> 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<S: Decodable + Copy> Decodable for Deg<S>

source§

fn decode<__D: Decoder>(d: &mut __D) -> Result<Deg<S>, __D::Error>

Deserialize a value using a Decoder.
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: Encodable + Copy> Encodable for Deg<S>

source§

fn encode<__S: Encoder>(&self, s: &mut __S) -> Result<(), __S::Error>

Serialize a value using an Encoder.
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 + Copy> 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 + Copy> 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 + SampleRange> Rand for Deg<S>

source§

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

Generates a random instance of this type using the specified source of randomness.
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<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> 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>,