Struct truck_modeling::base::Deg [−]
#[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
type Epsilon = <S as AbsDiffEq<S>>::Epsilon
type Epsilon = <S as AbsDiffEq<S>>::Epsilon
Used for specifying relative comparisons.
pub fn default_epsilon() -> <S as AbsDiffEq<S>>::Epsilon
pub fn default_epsilon() -> <S as AbsDiffEq<S>>::Epsilon
The default tolerance to use when testing values that are close together. Read more
pub fn abs_diff_eq(
&self,
other: &Deg<S>,
epsilon: <S as AbsDiffEq<S>>::Epsilon
) -> bool
pub fn abs_diff_eq(
&self,
other: &Deg<S>,
epsilon: <S as AbsDiffEq<S>>::Epsilon
) -> bool
A test for equality that uses the absolute difference to compute the approximate equality of two numbers. Read more
fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
The inverse of [AbsDiffEq::abs_diff_eq
].
pub fn add_assign(&mut self, other: Deg<S>)
pub fn add_assign(&mut self, other: Deg<S>)
Performs the +=
operation. Read more
type Unitless = S
Compute the sine and cosine of the angle, returning the result as a pair. Read more
Compute the arcsine of the ratio, returning the resulting angle. Read more
Compute the arccosine of the ratio, returning the resulting angle. Read more
Compute the arctangent of the ratio, returning the resulting angle. Read more
fn normalize(self) -> Self
fn normalize(self) -> Self
Return the angle, normalized to the range [0, full_turn)
.
fn normalize_signed(self) -> Self
fn normalize_signed(self) -> Self
Return the angle, normalized to the range [-turn_div_2, turn_div_2)
.
fn opposite(self) -> Self
fn opposite(self) -> Self
Return the angle rotated by half a turn.
fn bisect(self, other: Self) -> Self
fn bisect(self, other: Self) -> Self
Returns the interior bisector of the two angles.
fn turn_div_2() -> Self
fn turn_div_2() -> Self
Half of a full rotation.
fn turn_div_3() -> Self
fn turn_div_3() -> Self
A third of a full rotation.
fn turn_div_4() -> Self
fn turn_div_4() -> Self
A quarter of a full rotation.
fn turn_div_6() -> Self
fn turn_div_6() -> Self
A sixth of a full rotation.
impl<'de, S> Deserialize<'de> for Deg<S> where
S: Deserialize<'de>,
impl<'de, S> Deserialize<'de> for Deg<S> where
S: Deserialize<'de>,
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<Deg<S>, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<Deg<S>, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
pub fn div_assign(&mut self, scalar: S)
pub fn div_assign(&mut self, scalar: S)
Performs the /=
operation. Read more
pub fn mul_assign(&mut self, scalar: S)
pub fn mul_assign(&mut self, scalar: S)
Performs the *=
operation. Read more
impl<S> PartialOrd<Deg<S>> for Deg<S> where
S: PartialOrd<S>,
impl<S> PartialOrd<Deg<S>> for Deg<S> where
S: PartialOrd<S>,
pub fn partial_cmp(&self, other: &Deg<S>) -> Option<Ordering>
pub fn partial_cmp(&self, other: &Deg<S>) -> Option<Ordering>
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
pub fn default_max_relative() -> <S as AbsDiffEq<S>>::Epsilon
pub fn default_max_relative() -> <S as AbsDiffEq<S>>::Epsilon
The default relative tolerance for testing values that are far-apart. Read more
pub fn relative_eq(
&self,
other: &Deg<S>,
epsilon: <S as AbsDiffEq<S>>::Epsilon,
max_relative: <S as AbsDiffEq<S>>::Epsilon
) -> bool
pub fn relative_eq(
&self,
other: &Deg<S>,
epsilon: <S as AbsDiffEq<S>>::Epsilon,
max_relative: <S as AbsDiffEq<S>>::Epsilon
) -> bool
A test for equality that uses a relative comparison if the values are far apart.
fn relative_ne(
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
fn relative_ne(
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
The inverse of [RelativeEq::relative_eq
].
pub fn rem_assign(&mut self, other: Deg<S>)
pub fn rem_assign(&mut self, other: Deg<S>)
Performs the %=
operation. Read more
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
pub fn sub_assign(&mut self, other: Deg<S>)
pub fn sub_assign(&mut self, other: Deg<S>)
Performs the -=
operation. Read more
pub fn default_max_ulps() -> u32
pub fn default_max_ulps() -> u32
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.
impl<S> StructuralPartialEq for Deg<S>
Auto Trait Implementations
impl<S> RefUnwindSafe for Deg<S> where
S: RefUnwindSafe,
impl<S> UnwindSafe for Deg<S> where
S: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more