Struct angular_units::Deg

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

An angular quantity measured in degrees.

Degrees are uniquely defined from 0..360.

Tuple Fields§

§0: T

Implementations§

Construct a Deg instance from base degrees, minutes and seconds.

The opposite of decompose. Equivalent to adding the components together:

    let angle = Deg(50.0) + ArcMinutes(30.0) + ArcSeconds(10.0);
    assert_eq!(angle, Deg::from_components(Deg(50.0),
        ArcMinutes(30.0), ArcSeconds(10.0)));

Split an angle in degrees into base degrees, minutes and seconds.

If the decomposition would not be perfect, seconds will be a fractional value.

Trait Implementations§

Used for specifying relative comparisons.
The default tolerance to use when testing values that are close together. Read more
A test for equality that uses the absolute difference to compute the approximate equality of two numbers. Read more
The inverse of ApproxEq::abs_diff_eq.
The resulting type after applying the + operator.
Performs the + operation. Read more
Performs the += operation. Read more
Internal type storing the angle value.
Construct a new angle. Read more
The length of a full rotation.
Return the scalar (unitless) value. Read more
Set the internal scalar value of the angle.
Whether the angle is in the standard domain.
Normalize the angle, wrapping it back into the standard domain. Read more
Compute the sine of an angle.
Compute the cosine of an angle.
Compute the tangent of an angle.
Simultaneously compute sine and cosine.
Compute the arcsine of a value, returning an angle.
Compute the arccosine of a value, returning an angle.
Compute the arctangent of a value, returning an angle.
Compute the arctangent of a value, using information from the numerator and denominator in order to increase the domain. Read more
Return one full rotation in some unit. Read more
Return one half of a full rotation in some unit.
Return one quarter of a full rotation in some unit.
Return the inverse of an angle. Read more
Return the reflection of an angle over the x axis. Read more
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Formats the value using the given formatter. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
Performs the /= operation. Read more
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Construct Self by converting a T.
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
Perform a linear interpolation between two angles. Read more
Perform a linear interpolation between two angles, going forward from self to right. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
Performs the *= operation. Read more
The resulting type after applying the - operator.
Performs the unary - operation. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
The default relative tolerance for testing values that are far-apart. Read more
A test for equality that uses a relative comparison if the values are far apart.
The inverse of ApproxEq::relative_eq.
The resulting type after applying the % operator.
Performs the % operation. Read more
Performs the %= operation. Read more
The resulting type after applying the - operator.
Performs the - operation. Read more
Performs the -= operation. Read more
The default ULPs to tolerate when testing values that are far-apart. Read more
A test for equality that uses units in the last place (ULP) if the values are far apart.
The inverse of ApproxEq::ulps_eq.
Returns the additive identity element of Self, 0. Read more
Returns true if self is equal to the additive identity.
Sets self to the additive identity element of Self, 0.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Construct an angle from self.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.