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§
source§impl<T: Float> Deg<T>
impl<T: Float> Deg<T>
sourcepub fn from_components(
degs: Deg<T>,
mins: ArcMinutes<T>,
secs: ArcSeconds<T>
) -> Self
pub fn from_components(
degs: Deg<T>,
mins: ArcMinutes<T>,
secs: ArcSeconds<T>
) -> Self
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)));
sourcepub fn decompose(self) -> (Deg<T>, ArcMinutes<T>, ArcSeconds<T>)
pub fn decompose(self) -> (Deg<T>, ArcMinutes<T>, ArcSeconds<T>)
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§
source§impl<T: Float + AbsDiffEq> AbsDiffEq<Deg<T>> for Deg<T>where
T::Epsilon: Clone,
impl<T: Float + AbsDiffEq> AbsDiffEq<Deg<T>> for Deg<T>where
T::Epsilon: Clone,
source§fn default_epsilon() -> Self::Epsilon
fn default_epsilon() -> Self::Epsilon
The default tolerance to use when testing values that are close together. Read more
source§impl<U, T> Add<U> for Deg<T>where
T: Float + Add<T, Output = T>,
U: IntoAngle<Deg<T>, OutputScalar = T>,
impl<U, T> Add<U> for Deg<T>where
T: Float + Add<T, Output = T>,
U: IntoAngle<Deg<T>, OutputScalar = T>,
source§impl<U, T> AddAssign<U> for Deg<T>where
T: Float + AddAssign<T>,
U: IntoAngle<Deg<T>, OutputScalar = T>,
impl<U, T> AddAssign<U> for Deg<T>where
T: Float + AddAssign<T>,
U: IntoAngle<Deg<T>, OutputScalar = T>,
source§fn add_assign(&mut self, rhs: U)
fn add_assign(&mut self, rhs: U)
Performs the
+=
operation. Read moresource§impl<T: Float> Angle for Deg<T>
impl<T: Float> Angle for Deg<T>
source§fn set_scalar(&mut self, value: T)
fn set_scalar(&mut self, value: T)
Set the internal scalar value of the angle.
source§fn is_normalized(&self) -> bool
fn is_normalized(&self) -> bool
Whether the angle is in the standard domain.
source§fn normalize(self) -> Deg<T>
fn normalize(self) -> Deg<T>
Normalize the angle, wrapping it back into the standard domain. Read more
source§fn atan2(y: T, x: T) -> Deg<T>
fn atan2(y: T, x: T) -> Deg<T>
Compute the arctangent of a value, using information from
the numerator and denominator in order to increase the domain. Read more
source§fn quarter_turn() -> Self
fn quarter_turn() -> Self
Return one quarter of a full rotation in some unit.
source§impl<T: DivAssign<T>> DivAssign<T> for Deg<T>
impl<T: DivAssign<T>> DivAssign<T> for Deg<T>
source§fn div_assign(&mut self, rhs: T)
fn div_assign(&mut self, rhs: T)
Performs the
/=
operation. Read moresource§impl<T: Float> From<ArcMinutes<T>> for Deg<T>
impl<T: Float> From<ArcMinutes<T>> for Deg<T>
source§fn from(from: ArcMinutes<T>) -> Deg<T>
fn from(from: ArcMinutes<T>) -> Deg<T>
Converts to this type from the input type.
source§impl<T: Float> From<ArcSeconds<T>> for Deg<T>
impl<T: Float> From<ArcSeconds<T>> for Deg<T>
source§fn from(from: ArcSeconds<T>) -> Deg<T>
fn from(from: ArcSeconds<T>) -> Deg<T>
Converts to this type from the input type.
source§impl<T, U> FromAngle<U> for Deg<T>where
U: Angle<Scalar = T>,
T: Float,
impl<T, U> FromAngle<U> for Deg<T>where
U: Angle<Scalar = T>,
T: Float,
source§fn from_angle(from: U) -> Deg<T>
fn from_angle(from: U) -> Deg<T>
Construct
Self
by converting a T
.source§impl<T: Float> Interpolate for Deg<T>
impl<T: Float> Interpolate for Deg<T>
source§impl<T: MulAssign<T>> MulAssign<T> for Deg<T>
impl<T: MulAssign<T>> MulAssign<T> for Deg<T>
source§fn mul_assign(&mut self, rhs: T)
fn mul_assign(&mut self, rhs: T)
Performs the
*=
operation. Read moresource§impl<T: PartialOrd> PartialOrd<Deg<T>> for Deg<T>
impl<T: PartialOrd> PartialOrd<Deg<T>> for Deg<T>
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<T: Float + RelativeEq> RelativeEq<Deg<T>> for Deg<T>where
T::Epsilon: Clone,
impl<T: Float + RelativeEq> RelativeEq<Deg<T>> for Deg<T>where
T::Epsilon: Clone,
source§fn default_max_relative() -> Self::Epsilon
fn default_max_relative() -> Self::Epsilon
The default relative tolerance for testing values that are far-apart. Read more
source§impl<T: RemAssign> RemAssign<Deg<T>> for Deg<T>
impl<T: RemAssign> RemAssign<Deg<T>> for Deg<T>
source§fn rem_assign(&mut self, rhs: Deg<T>)
fn rem_assign(&mut self, rhs: Deg<T>)
Performs the
%=
operation. Read moresource§impl<U, T> Sub<U> for Deg<T>where
T: Float + Sub<T, Output = T>,
U: IntoAngle<Deg<T>, OutputScalar = T>,
impl<U, T> Sub<U> for Deg<T>where
T: Float + Sub<T, Output = T>,
U: IntoAngle<Deg<T>, OutputScalar = T>,
source§impl<U, T> SubAssign<U> for Deg<T>where
T: Float + SubAssign<T>,
U: IntoAngle<Deg<T>, OutputScalar = T>,
impl<U, T> SubAssign<U> for Deg<T>where
T: Float + SubAssign<T>,
U: IntoAngle<Deg<T>, OutputScalar = T>,
source§fn sub_assign(&mut self, rhs: U)
fn sub_assign(&mut self, rhs: U)
Performs the
-=
operation. Read moresource§impl<T: Float + UlpsEq> UlpsEq<Deg<T>> for Deg<T>where
T::Epsilon: Clone,
impl<T: Float + UlpsEq> UlpsEq<Deg<T>> for Deg<T>where
T::Epsilon: Clone,
impl<T: Copy> Copy for Deg<T>
impl<T> StructuralPartialEq for Deg<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for Deg<T>where
T: RefUnwindSafe,
impl<T> Send for Deg<T>where
T: Send,
impl<T> Sync for Deg<T>where
T: Sync,
impl<T> Unpin for Deg<T>where
T: Unpin,
impl<T> UnwindSafe for Deg<T>where
T: UnwindSafe,
Blanket Implementations§
source§impl<T, U> IntoAngle<U> for Twhere
U: Angle<Scalar = <T as Angle>::Scalar> + FromAngle<T>,
T: Angle,
impl<T, U> IntoAngle<U> for Twhere
U: Angle<Scalar = <T as Angle>::Scalar> + FromAngle<T>,
T: Angle,
type OutputScalar = <T as Angle>::Scalar
source§fn into_angle(self) -> U
fn into_angle(self) -> U
Construct an angle from
self
.