pub struct Equatorial { /* private fields */ }Expand description
An equatorial sky position (right ascension, declination) tagged with an
Epoch. After construction, ra ∈ [0, 360)° and dec ∈ [-90, 90]°.
Implementations§
Source§impl Equatorial
impl Equatorial
Sourcepub fn new(ra: Angle, dec: Angle, epoch: Epoch) -> Result<Self>
pub fn new(ra: Angle, dec: Angle, epoch: Epoch) -> Result<Self>
Construct from RA/Dec angles at an epoch, validating domains.
§Errors
Error::OutOfRange if RA ∉ [0, 360), Dec ∉ [-90, 90], or the epoch
year is non-finite.
Sourcepub fn parse(ra: &str, dec: &str, epoch: Epoch) -> Result<Self>
pub fn parse(ra: &str, dec: &str, epoch: Epoch) -> Result<Self>
Parse RA and Dec strings (sexagesimal or decimal) at an epoch.
RA accepts HH:MM:SS(.s), HH MM SS, or a bare decimal in degrees
(sexagesimal RA is hours ×15). Dec accepts ±DD:MM:SS(.s), ±DD MM SS,
or decimal degrees.
§Errors
Error::ParseCoord on malformed input; Error::OutOfRange on domain.
Sourcepub fn parse_j2000(ra: &str, dec: &str) -> Result<Self>
pub fn parse_j2000(ra: &str, dec: &str) -> Result<Self>
Sourcepub fn to_degrees(self) -> (f64, f64)
pub fn to_degrees(self) -> (f64, f64)
(ra_degrees, dec_degrees).
Sourcepub fn ra_to_sexagesimal(self, decimals: usize) -> String
pub fn ra_to_sexagesimal(self, decimals: usize) -> String
Format RA as HH:MM:SS.sss with the given number of fractional-second digits.
Sourcepub fn dec_to_sexagesimal(self, decimals: usize) -> String
pub fn dec_to_sexagesimal(self, decimals: usize) -> String
Format Dec as ±DD:MM:SS.sss with the given number of fractional-second digits.
Trait Implementations§
Source§impl Clone for Equatorial
impl Clone for Equatorial
Source§fn clone(&self) -> Equatorial
fn clone(&self) -> Equatorial
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for Equatorial
Source§impl Debug for Equatorial
impl Debug for Equatorial
Source§impl PartialEq for Equatorial
impl PartialEq for Equatorial
impl StructuralPartialEq for Equatorial
Auto Trait Implementations§
impl Freeze for Equatorial
impl RefUnwindSafe for Equatorial
impl Send for Equatorial
impl Sync for Equatorial
impl Unpin for Equatorial
impl UnsafeUnpin for Equatorial
impl UnwindSafe for Equatorial
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