pub struct Angle { /* private fields */ }Expand description
A unit-aware angle, stored internally in radians.
Construction and read-out are available in degrees, radians, arcminutes,
arcseconds, and hours (1 hour = 15°). Normalization is explicit — an Angle
holds whatever finite value it was given until you ask for a normalized form.
Implementations§
Source§impl Angle
impl Angle
Sourcepub const fn from_radians(radians: f64) -> Self
pub const fn from_radians(radians: f64) -> Self
Construct from radians.
Sourcepub fn from_degrees(degrees: f64) -> Self
pub fn from_degrees(degrees: f64) -> Self
Construct from decimal degrees.
Sourcepub fn from_arcminutes(arcmin: f64) -> Self
pub fn from_arcminutes(arcmin: f64) -> Self
Construct from arcminutes (1/60 degree).
Sourcepub fn from_arcseconds(arcsec: f64) -> Self
pub fn from_arcseconds(arcsec: f64) -> Self
Construct from arcseconds (1/3600 degree).
Sourcepub fn from_hours(hours: f64) -> Self
pub fn from_hours(hours: f64) -> Self
Construct from hours of right ascension (1 hour = 15°).
Sourcepub fn arcminutes(self) -> f64
pub fn arcminutes(self) -> f64
Value in arcminutes.
Sourcepub fn arcseconds(self) -> f64
pub fn arcseconds(self) -> f64
Value in arcseconds.
Sourcepub fn normalized_0_360(self) -> Self
pub fn normalized_0_360(self) -> Self
Return an equivalent angle wrapped into [0, 360) degrees.
Sourcepub fn normalized_pm_180(self) -> Self
pub fn normalized_pm_180(self) -> Self
Return an equivalent angle wrapped into (-180, 180] degrees.
Trait Implementations§
impl Copy for Angle
Source§impl PartialOrd for Angle
impl PartialOrd 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