pub struct Angle(/* private fields */);Expand description
A plane angle, stored canonically in radians.
§Construction
use space_units::Angle;
let a = Angle::from_deg(90.0);
let b = Angle::from_rad(std::f64::consts::FRAC_PI_2);With the NumericExt trait in scope:
use space_units::{Angle, NumericExt as _};
let a = 90.0.deg();
let b = (std::f64::consts::FRAC_PI_2).rad();§Typed arithmetic
| Expression | Result |
|---|---|
Angle / Time | AngularVelocity |
Implementations§
Source§impl Angle
impl Angle
Sourcepub const fn from_arcmin(val: f64) -> Self
pub const fn from_arcmin(val: f64) -> Self
Creates an angle from a value in arc-minutes.
Sourcepub const fn from_arcsec(val: f64) -> Self
pub const fn from_arcsec(val: f64) -> Self
Creates an angle from a value in arc-seconds.
Sourcepub const fn from_hour_angle(val: f64) -> Self
pub const fn from_hour_angle(val: f64) -> Self
Creates an angle from a value in hour angles.
Sourcepub const fn in_hour_angle(self) -> f64
pub const fn in_hour_angle(self) -> f64
Returns the angle in hour angles.
Sourcepub fn display_as(self, unit: AngleUnit) -> DisplayWithUnit
pub fn display_as(self, unit: AngleUnit) -> DisplayWithUnit
Returns a display wrapper that formats the angle in the specified unit.
Trait Implementations§
Source§impl AddAssign for Angle
impl AddAssign for Angle
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+= operation. Read moreSource§impl Div<Time> for Angle
impl Div<Time> for Angle
Source§type Output = AngularVelocity
type Output = AngularVelocity
The resulting type after applying the
/ operator.Source§impl DivAssign<f64> for Angle
impl DivAssign<f64> for Angle
Source§fn div_assign(&mut self, rhs: f64)
fn div_assign(&mut self, rhs: f64)
Performs the
/= operation. Read moreSource§impl MulAssign<f64> for Angle
impl MulAssign<f64> for Angle
Source§fn mul_assign(&mut self, rhs: f64)
fn mul_assign(&mut self, rhs: f64)
Performs the
*= operation. Read moreSource§impl PartialOrd for Angle
impl PartialOrd for Angle
Source§impl SubAssign for Angle
impl SubAssign for Angle
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-= operation. Read moreimpl Copy for Angle
impl StructuralPartialEq for Angle
Auto Trait Implementations§
impl Freeze for Angle
impl RefUnwindSafe for Angle
impl Send for Angle
impl Sync for Angle
impl Unpin for Angle
impl UnsafeUnpin for Angle
impl UnwindSafe for Angle
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