alloy::math

Struct Degree

source
#[repr(transparent)]
pub struct Degree(pub f32);
Expand description

Representation of a Degree unit of angles.

It is not an SI unit—the SI unit of angular measure is the radian—but it is mentioned in the SI brochure as an accepted unit. Because a full rotation equals 2π radians, one degree is equivalent to π/180 radians.

Tuple Fields§

§0: f32

Implementations§

source§

impl Degree

source

pub fn to_radians(self) -> Radian

Converts this Degree into Radian.

§Example

Basic use:


assert_eq!(Degree::ONE_REVOLUTION.to_radians(), Radian::ONE_REVOLUTION);
source

pub const fn to_degrees(self) -> Degree

Identity conversion.

This exists for symmetry with the other angle definitions.

§Example

Basic use:


assert_eq!(Degree::ONE_REVOLUTION.to_degrees(), Degree::ONE_REVOLUTION);
source

pub fn to_gradians(self) -> Gradian

Converts this Degree into Gradian.

§Example

Basic use:


let lhs = Gradian::ONE_REVOLUTION.to_gradians();
let rhs = Gradian::ONE_REVOLUTION;
// Degree => Gradian conversions are less exact (to ~5 decimal places with
// 32-bit IEEE floats)
assert!((lhs - rhs).abs() <= 0.0001);
source

pub fn from_radians(angle: Radian) -> Self

Constructs a new Degree object from an existing angle.

§Parameters
  • angle - the angle to construct from
§Example

Basic use:


assert_eq!(Degree::from_radians(Radian::ONE_REVOLUTION), Degree::ONE_REVOLUTION);
source

pub fn from_degrees(angle: Degree) -> Self

Constructs a new Degree object from an existing angle.

This exists for symmetry with the other angle definitions. This is an identity function.

§Parameters
  • angle - the angle to construct from
§Example

Basic use:


assert_eq!(Degree::from_degrees(Degree::ONE_REVOLUTION), Degree::ONE_REVOLUTION);
source

pub fn from_gradians(angle: Gradian) -> Self

Constructs a new Degree object from an existing angle.

§Parameters
  • angle - the angle to construct from
§Example

Basic use:


assert_eq!(Degree::from_gradians(Gradian::ONE_REVOLUTION), Degree::ONE_REVOLUTION);
source§

impl Degree

source

pub const ONE_REVOLUTION: Self = _

Constant for the number of units of Self required to perform one full revolution around a unit circle.

source

pub const fn new(value: f32) -> Self

Constructs a new instance of this angle type

§Parameters
  • value - the number of units
source

pub fn constrained(self) -> Self

Constructs a new instance of this angle by constraining the result to be within one revolution.

Note: This will

source

pub fn revolutions(self) -> f32

Counts the number of times this angle has revolved round the unit circle.

source

pub fn abs(self) -> Self

Computes the absolute value of this angle and returns it.

Methods from Deref<Target = f32>§

1.43.0 · source

pub const RADIX: u32 = 2u32

1.43.0 · source

pub const MANTISSA_DIGITS: u32 = 24u32

1.43.0 · source

pub const DIGITS: u32 = 6u32

1.43.0 · source

pub const EPSILON: f32 = 1.1920929E-7f32

1.43.0 · source

pub const MIN: f32 = -3.40282347E+38f32

1.43.0 · source

pub const MIN_POSITIVE: f32 = 1.17549435E-38f32

1.43.0 · source

pub const MAX: f32 = 3.40282347E+38f32

1.43.0 · source

pub const MIN_EXP: i32 = -125i32

1.43.0 · source

pub const MAX_EXP: i32 = 128i32

1.43.0 · source

pub const MIN_10_EXP: i32 = -37i32

1.43.0 · source

pub const MAX_10_EXP: i32 = 38i32

1.43.0 · source

pub const NAN: f32 = NaN_f32

1.43.0 · source

pub const INFINITY: f32 = +Inf_f32

1.43.0 · source

pub const NEG_INFINITY: f32 = -Inf_f32

1.62.0 · source

pub fn total_cmp(&self, other: &f32) -> Ordering

Returns the ordering between self and other.

Unlike the standard partial comparison between floating point numbers, this comparison always produces an ordering in accordance to the totalOrder predicate as defined in the IEEE 754 (2008 revision) floating point standard. The values are ordered in the following sequence:

  • negative quiet NaN
  • negative signaling NaN
  • negative infinity
  • negative numbers
  • negative subnormal numbers
  • negative zero
  • positive zero
  • positive subnormal numbers
  • positive numbers
  • positive infinity
  • positive signaling NaN
  • positive quiet NaN.

The ordering established by this function does not always agree with the PartialOrd and PartialEq implementations of f32. For example, they consider negative and positive zero equal, while total_cmp doesn’t.

The interpretation of the signaling NaN bit follows the definition in the IEEE 754 standard, which may not match the interpretation by some of the older, non-conformant (e.g. MIPS) hardware implementations.

§Example
struct GoodBoy {
    name: String,
    weight: f32,
}

let mut bois = vec![
    GoodBoy { name: "Pucci".to_owned(), weight: 0.1 },
    GoodBoy { name: "Woofer".to_owned(), weight: 99.0 },
    GoodBoy { name: "Yapper".to_owned(), weight: 10.0 },
    GoodBoy { name: "Chonk".to_owned(), weight: f32::INFINITY },
    GoodBoy { name: "Abs. Unit".to_owned(), weight: f32::NAN },
    GoodBoy { name: "Floaty".to_owned(), weight: -5.0 },
];

bois.sort_by(|a, b| a.weight.total_cmp(&b.weight));

// `f32::NAN` could be positive or negative, which will affect the sort order.
if f32::NAN.is_sign_negative() {
    assert!(bois.into_iter().map(|b| b.weight)
        .zip([f32::NAN, -5.0, 0.1, 10.0, 99.0, f32::INFINITY].iter())
        .all(|(a, b)| a.to_bits() == b.to_bits()))
} else {
    assert!(bois.into_iter().map(|b| b.weight)
        .zip([-5.0, 0.1, 10.0, 99.0, f32::INFINITY, f32::NAN].iter())
        .all(|(a, b)| a.to_bits() == b.to_bits()))
}

Trait Implementations§

source§

impl Add<Degree> for Gradian

source§

type Output = Gradian

The resulting type after applying the + operator.
source§

fn add(self, rhs: Degree) -> Self::Output

Performs the + operation. Read more
source§

impl Add<Degree> for Radian

source§

type Output = Radian

The resulting type after applying the + operator.
source§

fn add(self, rhs: Degree) -> Self::Output

Performs the + operation. Read more
source§

impl Add<Degree> for Unit

source§

type Output = Unit

The resulting type after applying the + operator.
source§

fn add(self, rhs: Degree) -> Self::Output

Performs the + operation. Read more
source§

impl Add<Gradian> for Degree

source§

type Output = Degree

The resulting type after applying the + operator.
source§

fn add(self, rhs: Gradian) -> Self::Output

Performs the + operation. Read more
source§

impl Add<Radian> for Degree

source§

type Output = Degree

The resulting type after applying the + operator.
source§

fn add(self, rhs: Radian) -> Self::Output

Performs the + operation. Read more
source§

impl Add<Unit> for Degree

source§

type Output = Degree

The resulting type after applying the + operator.
source§

fn add(self, rhs: Unit) -> Self::Output

Performs the + operation. Read more
source§

impl Add for Degree

source§

type Output = Degree

The resulting type after applying the + operator.
source§

fn add(self, rhs: Degree) -> Self::Output

Performs the + operation. Read more
source§

impl AddAssign<Degree> for Gradian

source§

fn add_assign(&mut self, rhs: Degree)

Performs the += operation. Read more
source§

impl AddAssign<Degree> for Radian

source§

fn add_assign(&mut self, rhs: Degree)

Performs the += operation. Read more
source§

impl AddAssign<Degree> for Unit

source§

fn add_assign(&mut self, rhs: Degree)

Performs the += operation. Read more
source§

impl AddAssign<Gradian> for Degree

source§

fn add_assign(&mut self, rhs: Gradian)

Performs the += operation. Read more
source§

impl AddAssign<Radian> for Degree

source§

fn add_assign(&mut self, rhs: Radian)

Performs the += operation. Read more
source§

impl AddAssign<Unit> for Degree

source§

fn add_assign(&mut self, rhs: Unit)

Performs the += operation. Read more
source§

impl AddAssign for Degree

source§

fn add_assign(&mut self, rhs: Degree)

Performs the += operation. Read more
source§

impl AlmostEq<Degree> for Gradian

source§

fn almost_eq(&self, other: &Degree) -> bool

Tests whether self is almost equal to other Read more
source§

impl AlmostEq<Degree> for Radian

source§

fn almost_eq(&self, other: &Degree) -> bool

Tests whether self is almost equal to other Read more
source§

impl AlmostEq<Degree> for Unit

source§

fn almost_eq(&self, other: &Degree) -> bool

Tests whether self is almost equal to other Read more
source§

impl AlmostEq<Gradian> for Degree

source§

fn almost_eq(&self, other: &Gradian) -> bool

Tests whether self is almost equal to other Read more
source§

impl AlmostEq<Radian> for Degree

source§

fn almost_eq(&self, other: &Radian) -> bool

Tests whether self is almost equal to other Read more
source§

impl AlmostEq<Unit> for Degree

source§

fn almost_eq(&self, other: &Unit) -> bool

Tests whether self is almost equal to other Read more
source§

impl AlmostEq for Degree

source§

fn almost_eq(&self, other: &Degree) -> bool

Tests whether self is almost equal to other Read more
source§

impl Angle for Degree

source§

fn to_angle<A: Angle>(self) -> A

Converts this Angle to any other generic Angle by converting to Unit as an intermediate value. Read more
source§

fn from_angle<A: Angle>(angle: A) -> Self

Constructs this angle from any other Angle unit value Read more
source§

impl AsMut<f32> for Degree

source§

fn as_mut(&mut self) -> &mut f32

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl AsRef<f32> for Degree

source§

fn as_ref(&self) -> &f32

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for Degree

source§

fn clone(&self) -> Degree

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 Debug for Degree

source§

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

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

impl Default for Degree

source§

fn default() -> Degree

Returns the “default value” for a type. Read more
source§

impl Deref for Degree

source§

type Target = f32

The resulting type after dereferencing.
source§

fn deref(&self) -> &f32

Dereferences the value.
source§

impl DerefMut for Degree

source§

fn deref_mut(&mut self) -> &mut f32

Mutably dereferences the value.
source§

impl Display for Degree

source§

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

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

impl Div<f32> for Degree

source§

type Output = Degree

The resulting type after applying the / operator.
source§

fn div(self, rhs: f32) -> Self::Output

Performs the / operation. Read more
source§

impl DivAssign for Degree

source§

fn div_assign(&mut self, rhs: Self)

Performs the /= operation. Read more
source§

impl From<Degree> for Gradian

source§

fn from(other: Degree) -> Self

Converts to this type from the input type.
source§

impl From<Degree> for Radian

source§

fn from(other: Degree) -> Self

Converts to this type from the input type.
source§

impl From<Degree> for Unit

source§

fn from(other: Degree) -> Self

Converts to this type from the input type.
source§

impl From<Gradian> for Degree

source§

fn from(other: Gradian) -> Self

Converts to this type from the input type.
source§

impl From<Radian> for Degree

source§

fn from(other: Radian) -> Self

Converts to this type from the input type.
source§

impl From<Unit> for Degree

source§

fn from(other: Unit) -> Self

Converts to this type from the input type.
source§

impl FromUnit for Degree

source§

fn from_unit(angle: Unit) -> Self

Converts the Unit angle into the new Angle type Read more
source§

impl Mul<Degree> for f32

source§

type Output = Degree

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Degree) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<f32> for Degree

source§

type Output = Degree

The resulting type after applying the * operator.
source§

fn mul(self, rhs: f32) -> Self::Output

Performs the * operation. Read more
source§

impl MulAssign for Degree

source§

fn mul_assign(&mut self, rhs: Self)

Performs the *= operation. Read more
source§

impl Near<Degree> for Gradian

source§

fn near(&self, other: &Degree, tolerance: &f32) -> bool

Tests whether self is “near” other relative top the specified tolerance Read more
source§

impl Near<Degree> for Radian

source§

fn near(&self, other: &Degree, tolerance: &f32) -> bool

Tests whether self is “near” other relative top the specified tolerance Read more
source§

impl Near<Degree> for Unit

source§

fn near(&self, other: &Degree, tolerance: &f32) -> bool

Tests whether self is “near” other relative top the specified tolerance Read more
source§

impl Near<Degree> for f32

source§

fn near(&self, other: &Degree, tolerance: &f32) -> bool

Tests whether self is “near” other relative top the specified tolerance Read more
source§

impl Near<Gradian> for Degree

source§

fn near(&self, other: &Gradian, tolerance: &f32) -> bool

Tests whether self is “near” other relative top the specified tolerance Read more
source§

impl Near<Radian> for Degree

source§

fn near(&self, other: &Radian, tolerance: &f32) -> bool

Tests whether self is “near” other relative top the specified tolerance Read more
source§

impl Near<Unit> for Degree

source§

fn near(&self, other: &Unit, tolerance: &f32) -> bool

Tests whether self is “near” other relative top the specified tolerance Read more
source§

impl Near<f32> for Degree

source§

fn near(&self, other: &f32, tolerance: &f32) -> bool

Tests whether self is “near” other relative top the specified tolerance Read more
source§

impl Near for Degree

source§

fn near(&self, other: &Degree, tolerance: &f32) -> bool

Tests whether self is “near” other relative top the specified tolerance Read more
source§

impl PartialEq<Degree> for Gradian

source§

fn eq(&self, other: &Degree) -> 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 PartialEq<Degree> for Radian

source§

fn eq(&self, other: &Degree) -> 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 PartialEq<Degree> for Unit

source§

fn eq(&self, other: &Degree) -> 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 PartialEq<Degree> for f32

source§

fn eq(&self, other: &Degree) -> 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 PartialEq<Gradian> for Degree

source§

fn eq(&self, other: &Gradian) -> 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 PartialEq<Radian> for Degree

source§

fn eq(&self, other: &Radian) -> 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 PartialEq<Unit> for Degree

source§

fn eq(&self, other: &Unit) -> 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 PartialEq<f32> for Degree

source§

fn eq(&self, other: &f32) -> 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 PartialEq for Degree

source§

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

source§

fn partial_cmp(&self, other: &Degree) -> 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 PartialOrd<Degree> for Radian

source§

fn partial_cmp(&self, other: &Degree) -> 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 PartialOrd<Degree> for Unit

source§

fn partial_cmp(&self, other: &Degree) -> 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 PartialOrd<Degree> for f32

source§

fn partial_cmp(&self, other: &Degree) -> 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 PartialOrd<Gradian> for Degree

source§

fn partial_cmp(&self, other: &Gradian) -> 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 PartialOrd<Radian> for Degree

source§

fn partial_cmp(&self, other: &Radian) -> 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 PartialOrd<Unit> for Degree

source§

fn partial_cmp(&self, other: &Unit) -> 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 PartialOrd<f32> for Degree

source§

fn partial_cmp(&self, other: &f32) -> 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 PartialOrd for Degree

source§

fn partial_cmp(&self, other: &Degree) -> 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 Rem<f32> for Degree

source§

type Output = Degree

The resulting type after applying the % operator.
source§

fn rem(self, rhs: f32) -> Self::Output

Performs the % operation. Read more
source§

impl RemAssign for Degree

source§

fn rem_assign(&mut self, rhs: Self)

Performs the %= operation. Read more
source§

impl Sub<Degree> for Gradian

source§

type Output = Gradian

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Degree) -> Self::Output

Performs the - operation. Read more
source§

impl Sub<Degree> for Radian

source§

type Output = Radian

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Degree) -> Self::Output

Performs the - operation. Read more
source§

impl Sub<Degree> for Unit

source§

type Output = Unit

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Degree) -> Self::Output

Performs the - operation. Read more
source§

impl Sub<Gradian> for Degree

source§

type Output = Degree

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Gradian) -> Self::Output

Performs the - operation. Read more
source§

impl Sub<Radian> for Degree

source§

type Output = Degree

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Radian) -> Self::Output

Performs the - operation. Read more
source§

impl Sub<Unit> for Degree

source§

type Output = Degree

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Unit) -> Self::Output

Performs the - operation. Read more
source§

impl Sub for Degree

source§

type Output = Degree

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Degree) -> Self::Output

Performs the - operation. Read more
source§

impl SubAssign<Degree> for Gradian

source§

fn sub_assign(&mut self, rhs: Degree)

Performs the -= operation. Read more
source§

impl SubAssign<Degree> for Radian

source§

fn sub_assign(&mut self, rhs: Degree)

Performs the -= operation. Read more
source§

impl SubAssign<Degree> for Unit

source§

fn sub_assign(&mut self, rhs: Degree)

Performs the -= operation. Read more
source§

impl SubAssign<Gradian> for Degree

source§

fn sub_assign(&mut self, rhs: Gradian)

Performs the -= operation. Read more
source§

impl SubAssign<Radian> for Degree

source§

fn sub_assign(&mut self, rhs: Radian)

Performs the -= operation. Read more
source§

impl SubAssign<Unit> for Degree

source§

fn sub_assign(&mut self, rhs: Unit)

Performs the -= operation. Read more
source§

impl SubAssign for Degree

source§

fn sub_assign(&mut self, rhs: Degree)

Performs the -= operation. Read more
source§

impl ToUnit for Degree

source§

fn to_unit(self) -> Unit

Converts this Degree into Unit.

source§

impl Transparent for Degree

source§

type Wrapped = f32

The type that is wrapped by the Transparent impl.
source§

fn from_ref(wrapped: &Self::Wrapped) -> &Self

Converts a reference to a type into a reference of the wrapper type. Read more
source§

fn from_ref_mut(wrapped: &mut Self::Wrapped) -> &mut Self

Converts a mut reference to a wrapped type into a mut reference to the wrapper. Read more
source§

impl Trig for Degree

source§

fn sin(self) -> f32

Computes the sine of this angle.
source§

fn cos(self) -> f32

Computes the cosine of this angle.
source§

fn tan(self) -> f32

Computes the tangent of this angle.
source§

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

Computes the sine and tangent of this angle.
source§

fn asin(value: f32) -> Self

Computes the arc-sine of the input value, returning the Angle Read more
source§

fn acos(value: f32) -> Self

Computes the arc-cosine of the input value, returning the Angle Read more
source§

fn atan(value: f32) -> Self

Computes the arc-tangent of the input value, returning the Angle Read more
source§

impl Copy for Degree

Auto Trait Implementations§

§

impl Freeze for Degree

§

impl RefUnwindSafe for Degree

§

impl Send for Degree

§

impl Sync for Degree

§

impl Unpin for Degree

§

impl UnwindSafe for Degree

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, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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 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> 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> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
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.