pub struct Rad<S>(pub S);
Expand description
An angle, in radians.
This type is marked as #[repr(C)]
.
Tuple Fields§
§0: S
Trait Implementations§
source§impl<S> AddAssign<Rad<S>> for Rad<S>where
S: BaseFloat + AddAssign<S>,
impl<S> AddAssign<Rad<S>> for Rad<S>where
S: BaseFloat + AddAssign<S>,
source§fn add_assign(&mut self, other: Rad<S>)
fn add_assign(&mut self, other: Rad<S>)
Performs the
+=
operation. Read moresource§impl<S> Angle for Rad<S>where
S: BaseFloat,
impl<S> Angle for Rad<S>where
S: BaseFloat,
type Unitless = S
source§fn sin_cos(self) -> (S, S)
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) -> Rad<S>
fn asin(a: S) -> Rad<S>
Compute the arcsine of the ratio, returning the resulting angle. Read more
source§fn acos(a: S) -> Rad<S>
fn acos(a: S) -> Rad<S>
Compute the arccosine of the ratio, returning the resulting angle. Read more
source§fn atan(a: S) -> Rad<S>
fn atan(a: S) -> Rad<S>
Compute the arctangent of the ratio, returning the resulting angle. Read more
fn atan2(a: S, b: S) -> Rad<S>
source§fn turn_div_2() -> Self
fn turn_div_2() -> Self
Half of a full rotation.
source§fn turn_div_3() -> Self
fn turn_div_3() -> Self
A third of a full rotation.
source§fn turn_div_4() -> Self
fn turn_div_4() -> Self
A quarter of a full rotation.
source§fn turn_div_6() -> Self
fn turn_div_6() -> Self
A sixth of a full rotation.
source§impl<S> ApproxEq for Rad<S>where
S: BaseFloat,
impl<S> ApproxEq for Rad<S>where
S: BaseFloat,
source§fn default_epsilon() -> <S as ApproxEq>::Epsilon
fn default_epsilon() -> <S as ApproxEq>::Epsilon
The default tolerance to use when testing values that are close together. Read more
source§fn default_max_relative() -> <S as ApproxEq>::Epsilon
fn default_max_relative() -> <S as ApproxEq>::Epsilon
The default relative tolerance for testing values that are far-apart. Read more
source§fn default_max_ulps() -> u32
fn default_max_ulps() -> u32
The default ULPs to tolerate when testing values that are far-apart. Read more
source§fn relative_eq(
&self,
other: &Rad<S>,
epsilon: <S as ApproxEq>::Epsilon,
max_relative: <S as ApproxEq>::Epsilon
) -> bool
fn relative_eq(
&self,
other: &Rad<S>,
epsilon: <S as ApproxEq>::Epsilon,
max_relative: <S as ApproxEq>::Epsilon
) -> bool
A test for equality that uses a relative comparison if the values are far apart.
source§fn ulps_eq(
&self,
other: &Rad<S>,
epsilon: <S as ApproxEq>::Epsilon,
max_ulps: u32
) -> bool
fn ulps_eq(
&self,
other: &Rad<S>,
epsilon: <S as ApproxEq>::Epsilon,
max_ulps: u32
) -> bool
A test for equality that uses units in the last place (ULP) if the values are far apart.
§fn relative_ne(
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
fn relative_ne(
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
The inverse of
ApproxEq::relative_eq
.source§impl<'de, S> Deserialize<'de> for Rad<S>where
S: Deserialize<'de>,
impl<'de, S> Deserialize<'de> for Rad<S>where
S: Deserialize<'de>,
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<Rad<S>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<Rad<S>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<S> DivAssign<S> for Rad<S>where
S: BaseFloat + DivAssign<S>,
impl<S> DivAssign<S> for Rad<S>where
S: BaseFloat + DivAssign<S>,
source§fn div_assign(&mut self, scalar: S)
fn div_assign(&mut self, scalar: S)
Performs the
/=
operation. Read moresource§impl<S> MulAssign<S> for Rad<S>where
S: BaseFloat + MulAssign<S>,
impl<S> MulAssign<S> for Rad<S>where
S: BaseFloat + MulAssign<S>,
source§fn mul_assign(&mut self, scalar: S)
fn mul_assign(&mut self, scalar: S)
Performs the
*=
operation. Read moresource§impl<S> PartialEq<Rad<S>> for Rad<S>where
S: PartialEq<S>,
impl<S> PartialEq<Rad<S>> for Rad<S>where
S: PartialEq<S>,
source§impl<S> PartialOrd<Rad<S>> for Rad<S>where
S: PartialOrd<S>,
impl<S> PartialOrd<Rad<S>> for Rad<S>where
S: PartialOrd<S>,
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
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 moresource§impl<S> RemAssign<Rad<S>> for Rad<S>where
S: BaseFloat + RemAssign<S>,
impl<S> RemAssign<Rad<S>> for Rad<S>where
S: BaseFloat + RemAssign<S>,
source§fn rem_assign(&mut self, other: Rad<S>)
fn rem_assign(&mut self, other: Rad<S>)
Performs the
%=
operation. Read moresource§impl<S> Serialize for Rad<S>where
S: Serialize,
impl<S> Serialize for Rad<S>where
S: Serialize,
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
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
source§impl<S> SubAssign<Rad<S>> for Rad<S>where
S: BaseFloat + SubAssign<S>,
impl<S> SubAssign<Rad<S>> for Rad<S>where
S: BaseFloat + SubAssign<S>,
source§fn sub_assign(&mut self, other: Rad<S>)
fn sub_assign(&mut self, other: Rad<S>)
Performs the
-=
operation. Read moreimpl<S> Copy for Rad<S>where
S: Copy,
impl<S> StructuralPartialEq for Rad<S>
Auto Trait Implementations§
impl<S> RefUnwindSafe for Rad<S>where
S: RefUnwindSafe,
impl<S> Send for Rad<S>where
S: Send,
impl<S> Sync for Rad<S>where
S: Sync,
impl<S> Unpin for Rad<S>where
S: Unpin,
impl<S> UnwindSafe for Rad<S>where
S: UnwindSafe,
Blanket Implementations§
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
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
. Read more§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more§fn as_any(&self) -> &(dyn Any + 'static)
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. Read more§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
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. Read more