#[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 for Deg<T>
impl<T: Float + AbsDiffEq> AbsDiffEq for Deg<T>
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§fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool
fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool
A test for equality that uses the absolute difference to compute the approximate
equality of two numbers.
Source§impl<U, T> AddAssign<U> for Deg<T>
impl<U, T> AddAssign<U> for Deg<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.
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>
impl<T, U> FromAngle<U> for Deg<T>
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 for Deg<T>
impl<T: PartialOrd> PartialOrd for Deg<T>
Source§impl<T: Float + RelativeEq> RelativeEq for Deg<T>
impl<T: Float + RelativeEq> RelativeEq for Deg<T>
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 for Deg<T>
impl<T: RemAssign> RemAssign 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> SubAssign<U> for Deg<T>
impl<U, T> SubAssign<U> for Deg<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 for Deg<T>
impl<T: Float + UlpsEq> UlpsEq for Deg<T>
impl<T: Copy> Copy for Deg<T>
impl<T> StructuralPartialEq for Deg<T>
Auto Trait Implementations§
impl<T> Freeze for Deg<T>where
T: Freeze,
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, U> IntoAngle<U> for T
impl<T, U> IntoAngle<U> for T
type OutputScalar = <T as Angle>::Scalar
Source§fn into_angle(self) -> U
fn into_angle(self) -> U
Construct an angle from
self
.