pub trait AngleUnits {
// Required methods
fn deg(&self) -> Result<Angle, AstroError>;
fn rad(&self) -> Result<Angle, AstroError>;
fn hours(&self) -> Result<Angle, AstroError>;
fn arcmin(&self) -> Result<Angle, AstroError>;
fn arcsec(&self) -> Result<Angle, AstroError>;
fn dms(&self) -> Result<Angle, AstroError>;
fn hms(&self) -> Result<Angle, AstroError>;
}Expand description
Parse strings as angles with explicit unit specification.
Implemented for str. Each method interprets the string value in its respective unit.
§Decimal Methods
deg()- Parse as decimal degreesrad()- Parse as radianshours()- Parse as decimal hours (1h = 15 deg)arcmin()- Parse as arcminutes (60’ = 1 deg)arcsec()- Parse as arcseconds (3600“ = 1 deg)
§Sexagesimal Methods
hms()- Parse hours:minutes:seconds formatdms()- Parse degrees:minutes:seconds format
Required Methods§
Sourcefn deg(&self) -> Result<Angle, AstroError>
fn deg(&self) -> Result<Angle, AstroError>
Parse as decimal degrees.
Sourcefn rad(&self) -> Result<Angle, AstroError>
fn rad(&self) -> Result<Angle, AstroError>
Parse as radians.
Sourcefn hours(&self) -> Result<Angle, AstroError>
fn hours(&self) -> Result<Angle, AstroError>
Parse as decimal hours (1 hour = 15 degrees).
Sourcefn arcmin(&self) -> Result<Angle, AstroError>
fn arcmin(&self) -> Result<Angle, AstroError>
Parse as arcminutes (60 arcmin = 1 degree).
Sourcefn arcsec(&self) -> Result<Angle, AstroError>
fn arcsec(&self) -> Result<Angle, AstroError>
Parse as arcseconds (3600 arcsec = 1 degree).
Sourcefn dms(&self) -> Result<Angle, AstroError>
fn dms(&self) -> Result<Angle, AstroError>
Parse degrees-minutes-seconds format. See module docs for accepted formats.
Sourcefn hms(&self) -> Result<Angle, AstroError>
fn hms(&self) -> Result<Angle, AstroError>
Parse hours-minutes-seconds format. See module docs for accepted formats.