Struct 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> AbsDiffEq for Deg<S>
where S: BaseFloat,

Source§

type Epsilon = <S as AbsDiffEq>::Epsilon

Used for specifying relative comparisons.
Source§

fn default_epsilon() -> <S as AbsDiffEq>::Epsilon

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

fn abs_diff_eq( &self, other: &Deg<S>, epsilon: <S as AbsDiffEq>::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> Add<&'a Deg<S>> for &'b Deg<S>
where S: BaseFloat,

Source§

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> Add<&'a Deg<S>> for Deg<S>
where S: BaseFloat,

Source§

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> Add<Deg<S>> for &'a Deg<S>
where S: BaseFloat,

Source§

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> Add for Deg<S>
where S: BaseFloat,

Source§

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> AddAssign for Deg<S>
where S: BaseFloat + AddAssign,

Source§

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

Performs the += operation. Read more
Source§

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

Source§

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 for Deg<S>
where S: Bounded,

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 for Deg<S>
where S: Clone,

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 for Deg<S>
where S: Debug,

Source§

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

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

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

Source§

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> Div<&'a Deg<S>> for Deg<S>
where S: BaseFloat,

Source§

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> Div<Deg<S>> for &'a Deg<S>
where S: BaseFloat,

Source§

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> Div<S> for &'a Deg<S>
where S: BaseFloat,

Source§

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> Div<S> for Deg<S>
where S: BaseFloat,

Source§

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> Div for Deg<S>
where S: BaseFloat,

Source§

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

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> Mul<S> for &'a Deg<S>
where S: BaseFloat,

Source§

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> Mul<S> for Deg<S>
where S: BaseFloat,

Source§

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> MulAssign<S> for Deg<S>
where S: BaseFloat + MulAssign,

Source§

fn mul_assign(&mut self, scalar: S)

Performs the *= operation. Read more
Source§

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

Source§

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> Neg for Deg<S>
where S: BaseFloat,

Source§

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 for Deg<S>
where S: PartialEq,

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

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

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

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

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

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<S> RelativeEq for Deg<S>
where S: BaseFloat,

Source§

fn default_max_relative() -> <S as AbsDiffEq>::Epsilon

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

fn relative_eq( &self, other: &Deg<S>, epsilon: <S as AbsDiffEq>::Epsilon, max_relative: <S as AbsDiffEq>::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> Rem<&'a Deg<S>> for &'b Deg<S>
where S: BaseFloat,

Source§

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> Rem<&'a Deg<S>> for Deg<S>
where S: BaseFloat,

Source§

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> Rem<Deg<S>> for &'a Deg<S>
where S: BaseFloat,

Source§

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> Rem for Deg<S>
where S: BaseFloat,

Source§

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> RemAssign for Deg<S>
where S: BaseFloat + RemAssign,

Source§

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

Performs the %= operation. Read more
Source§

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

Source§

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> Sub<&'a Deg<S>> for Deg<S>
where S: BaseFloat,

Source§

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> Sub<Deg<S>> for &'a Deg<S>
where S: BaseFloat,

Source§

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> Sub for Deg<S>
where S: BaseFloat,

Source§

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> SubAssign for Deg<S>
where S: BaseFloat + SubAssign,

Source§

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

Performs the -= operation. Read more
Source§

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

Source§

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

Takes an iterator and generates Self from the elements by “summing up” the items.
Source§

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

Source§

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

Takes an iterator and generates Self from the elements by “summing up” the items.
Source§

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

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: &Deg<S>, epsilon: <S as AbsDiffEq>::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> Zero for Deg<S>
where S: BaseFloat,

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 for Deg<S>
where S: Copy,

Source§

impl<S> StructuralPartialEq for Deg<S>

Auto Trait Implementations§

§

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

§

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 T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<S> FromSample<S> for S

Source§

fn from_sample_(s: S) -> S

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

Source§

fn into_sample(self) -> T

Source§

impl<T> LowerBounded for T
where T: Bounded,

Source§

fn min_value() -> T

Returns the smallest finite number this type can represent
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

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> ToSample<U> for T
where U: FromSample<T>,

Source§

fn to_sample_(self) -> U

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> UpperBounded for T
where T: Bounded,

Source§

fn max_value() -> T

Returns the largest finite number this type can represent
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

Source§

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

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,