Struct cgmath::Deg

source ·
pub struct Deg<S> {
    pub s: S,
}
Expand description

An angle, in degrees

Fields§

§s: S

Trait Implementations§

source§

impl<R: Into<Rad<S>>, S: BaseFloat> Add<R> for Deg<S>

§

type Output = Deg<S>

The resulting type after applying the + operator.
source§

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

Performs the + operation. Read more
source§

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

source§

fn from<A: Angle<S>>(theta: A) -> Deg<S>

Create a new angle from any other valid angle.
source§

fn full_turn() -> Deg<S>

source§

fn neg_self(&mut self)

Negate this angle, in-place.
source§

fn add_a(&self, other: Self) -> Self

Add this angle with another, returning the new angle.
source§

fn sub_a(&self, other: Self) -> Self

Subtract another angle from this one, returning the new angle.
source§

fn div_a(&self, other: Self) -> S

Divide this angle by another, returning the ratio.
source§

fn rem_a(&self, other: Self) -> S

Take the remainder of this angle with another.
source§

fn mul_s(&self, s: S) -> Self

Multiply this angle by a scalar, returning the new angle.
source§

fn div_s(&self, s: S) -> Self

Divide this angle by a scalar, returing the new angle.
source§

fn rem_s(&self, s: S) -> Self

Take the remainder of this angle by a scalar, returning the new angle.
source§

fn add_self_a(&mut self, other: Self)

Add this angle with another, in-place.
source§

fn sub_self_a(&mut self, other: Self)

Subtract another angle from this one, in-place.
source§

fn mul_self_s(&mut self, s: S)

Multiply this angle by a scalar, in-place.
source§

fn div_self_s(&mut self, s: S)

Divide this angle by a scalar, in-place.
source§

fn rem_self_s(&mut self, s: S)

Take the remainder of this angle by a scalar, in-place.
source§

fn normalize(&self) -> Self

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

fn normalize_self(&mut self)

Normalize the angle 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

source§

fn turn_div_3() -> Self

source§

fn turn_div_4() -> Self

source§

fn turn_div_6() -> Self

source§

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

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> 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: BaseFloat + 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> 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<S: Encodable> 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(d: 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(r: Rad<S>) -> Deg<S>

Converts to this type from the input type.
source§

impl<S: Hash> Hash for Deg<S>

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<R: Into<Rad<S>>, S: BaseFloat> Mul<R> for Deg<S>

§

type Output = Deg<S>

The resulting type after applying the * operator.
source§

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

Performs the * 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: BaseFloat> One for Deg<S>

source§

fn one() -> Deg<S>

Returns the multiplicative identity element of Self, 1. Read more
source§

fn set_one(&mut self)

Sets self to the multiplicative identity element of Self, 1.
source§

fn is_one(&self) -> boolwhere Self: PartialEq<Self>,

Returns true if self is equal to the multiplicative identity. 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 + PartialOrd + SampleRange + Rand> 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<R: Into<Rad<S>>, S: BaseFloat> Sub<R> for Deg<S>

§

type Output = Deg<S>

The resulting type after applying the - operator.
source§

fn sub(self, other: R) -> 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.