![]() |
SuperNOVAS C++ API v1.6
High-precision C/C++ astrometry library
|
A representation of a regularized angle, which can also be represented as a time value in the 0 to 24h range. More...
#include <supernovas.h>
Public Member Functions | |
| TimeAngle (const Angle &angle) | |
| Instantiates an angle, to be represented as time on a 24 hour interval, from an angle instance. | |
| TimeAngle (const std::string &str) | |
| Instantiates an angle, to be represented as time on a 24 hour interval, from a HMS or decimal string representation of time. | |
| TimeAngle (double radians) | |
| Instantiates an angle, to be represented as time on a 24 hour interval, from a canonical angle in radians. | |
| double | hours () const |
| Returns this angle as hours on a 24h interval. | |
| double | minutes () const |
| Returns this angle as minutes inside a 24h interval. | |
| Angle | operator+ (const Angle &r) const override |
| Returns a new angle that is the sum of this angle and the specified other angle. | |
| TimeAngle | operator+ (const Interval &other) const |
| Returns a new time-angle that is the sum of this time-angle and the specified time interval. | |
| TimeAngle | operator+ (const TimeAngle &r) const |
| Returns a new time-angle that is the sum of this rime-angle and the specified other time-angle. | |
| Angle | operator- (const Angle &r) const override |
| Returns a new angle that is the difference of this angle and the specified other angle. | |
| TimeAngle | operator- (const Interval &other) const |
| Returns a new time-angle that is the difference of this time-angle and the specified time interval. | |
| TimeAngle | operator- (const TimeAngle &r) const |
| Returns a new time-angle that is the difference of this time-angle and the specified other time-angle. | |
| double | seconds () const |
| Returns this angle as seconds on a 24h interval. | |
| std::string | to_string (enum novas_separator_type separator=NOVAS_SEP_UNITS_AND_SPACES, int decimals=3) const override |
| Provides a DDD:MM:SS.SSS representation of the angle with the specified separators and decimal places for the arc seconds. | |
| Public Member Functions inherited from supernovas::Angle | |
| Angle (const std::string &str) | |
| Instantiates an angle from its string representation, either as decimal degrees or as [-]DDD:MM:SS.SSS. | |
| Angle (double radians) | |
| Instantiates a new angle with the specified value in radians. | |
| virtual | ~Angle () |
| double | arcmin () const |
| Returns the angle in arc minutes. | |
| double | arcsec () const |
| Returns the angle in arc seconds. | |
| double | deg () const |
| Returns the angle in degrees. | |
| bool | equals (const Angle &angle, double precision=Unit::uas) const |
| Checks if this angle instance equals another within the specified absolute precision. | |
| double | fraction () const |
| Returns the angle as a fraction of the circle. | |
| double | mas () const |
| Returns the angle in milliarcseconds. | |
| bool | operator!= (const Angle &angle) const |
| Checks if this angle instance differs from another by more than 1 μas. | |
| bool | operator== (const Angle &angle) const |
| Checks if this angle instance equals another within the 1 μas. | |
| double | rad () const |
| Returns the angle in radians. | |
| double | uas () const |
| Returns the angle in microarcseconds. | |
| Public Member Functions inherited from supernovas::Validating | |
| bool | is_valid () const |
| Returns the previously set 'valid' stae of the implementing instance. | |
| operator bool () const | |
| Objects that implement Validating can be used in conditionals directly, without explicitly calling is_valid(). | |
Static Public Member Functions | |
| static TimeAngle | hours (double value) |
| Returns a new time-angle given the specified time value in hours. | |
| static TimeAngle | minutes (double value) |
| Returns a new time-angle given the specified time value in minutes. | |
| static const TimeAngle & | noon () |
| Returns a reference to a statically defined time angle corresponding to noon (12h). | |
| static TimeAngle | seconds (double value) |
| Returns a new time-angle given the specified time value in seconds. | |
| static const TimeAngle & | zero () |
| Returns a reference to a statically defined time-angle that represents a zero angle. | |
| Static Public Member Functions inherited from supernovas::Angle | |
| static const Angle & | undefined () |
| Returns a reference to a statically defined standard invalid angle. | |
Additional Inherited Members | |
| Static Public Attributes inherited from supernovas::Angle | |
| static constexpr int | east = 1 |
| East direction sign, e.g 19.5 * Unit::deg * Angle::east for 19.5 deg East. | |
| static constexpr int | north = 1 |
| North direction sign, e.g 33.4 * Unit::deg * Angle::north for 33.4 deg North. | |
| static constexpr int | south = -1 |
| South direction sign, e.g 90.0 * Unit::deg * Angle::south for the South pole. | |
| static constexpr int | west = -1 |
| West direction sign, e.g 155.1 * Unit::deg * Angle::west for 155.1 deg West. | |
| Protected Member Functions inherited from supernovas::Validating | |
| Validating () | |
| dummy constructor; | |
| Protected Attributes inherited from supernovas::Angle | |
| double | _rad |
| [rad] stored angle value, usually [-π:π), but can be different for subclasses. | |
| Protected Attributes inherited from supernovas::Validating | |
| bool | _valid = false |
| the state variable. | |
A representation of a regularized angle, which can also be represented as a time value in the 0 to 24h range.
It can be expressed both in terms various commonly used angular units, or in terms of time units, as needed. It may also be used to instantiate time-angles from decimal or from HH:MM:SS.SSS string representations of time in hours.
|
explicit |
Instantiates an angle, to be represented as time on a 24 hour interval, from a canonical angle in radians.
| radians | [rad] the angle in radians |
References supernovas::Angle::_rad, and TWOPI.
Referenced by hours(), minutes(), noon(), operator+(), operator+(), operator-(), operator-(), seconds(), and zero().
|
explicit |
Instantiates an angle, to be represented as time on a 24 hour interval, from a HMS or decimal string representation of time.
| str | A decimal or HMS representation of time, using spaces, colons, and/or the letters h, m (and optionally s) as separators. |
References novas_str_hours().
|
explicit |
Instantiates an angle, to be represented as time on a 24 hour interval, from an angle instance.
| angle | an angle to initialize with. |
| double supernovas::TimeAngle::hours | ( | ) | const |
Returns this angle as hours on a 24h interval.
References supernovas::Angle::_rad, and supernovas::Unit::hour_angle.
Referenced by supernovas::CalendarDate::CalendarDate(), supernovas::CatalogEntry::CatalogEntry(), minutes(), seconds(), supernovas::Equatorial::to_ecliptic(), supernovas::Equatorial::to_galactic(), and to_string().
|
static |
Returns a new time-angle given the specified time value in hours.
The input time may be any real value, but the returned time angle will be restricted to a single 24 hour interval.
| value | [h] the angle defined as hours of time. |
References TimeAngle(), supernovas::Unit::hour_angle, and supernovas::Validating::is_valid().
| double supernovas::TimeAngle::minutes | ( | ) | const |
Returns this angle as minutes inside a 24h interval.
References hours().
|
static |
Returns a new time-angle given the specified time value in minutes.
The input time may be any real value, but the returned time angle will be restricted to a single 24 hour interval.
| value | [m] the angle defined as minutes of time. |
References TimeAngle(), supernovas::Unit::hour_angle, and supernovas::Validating::is_valid().
|
static |
Returns a reference to a statically defined time angle corresponding to noon (12h).
References TimeAngle(), and supernovas::Unit::hour_angle.
|
overridevirtual |
Returns a new angle that is the sum of this angle and the specified other angle.
| r | the other angle on the right-hand-side. |
Reimplemented from supernovas::Angle.
References supernovas::Angle::operator+().
Returns a new time-angle that is the sum of this time-angle and the specified time interval.
| offset | the time interval on the right-hand-side. |
References TimeAngle(), supernovas::Unit::hour_angle, supernovas::Interval::hours(), supernovas::Validating::is_valid(), and supernovas::Angle::rad().
Returns a new time-angle that is the sum of this rime-angle and the specified other time-angle.
| r | the other time-angle on the right-hand-side. |
References TimeAngle(), supernovas::Validating::is_valid(), and supernovas::Angle::rad().
|
overridevirtual |
Returns a new angle that is the difference of this angle and the specified other angle.
| r | the other angle on the right-hand-side. |
Reimplemented from supernovas::Angle.
References supernovas::Angle::operator-().
Returns a new time-angle that is the difference of this time-angle and the specified time interval.
| offset | the time interval on the right-hand-side. |
References TimeAngle(), supernovas::Unit::hour_angle, supernovas::Interval::hours(), supernovas::Validating::is_valid(), and supernovas::Angle::rad().
Returns a new time-angle that is the difference of this time-angle and the specified other time-angle.
| r | the other time-angle on the right-hand-side. |
References TimeAngle(), supernovas::Validating::is_valid(), and supernovas::Angle::rad().
| double supernovas::TimeAngle::seconds | ( | ) | const |
Returns this angle as seconds on a 24h interval.
References hours().
|
static |
Returns a new time-angle given the specified time value in seconds.
The input time may be any real value, but the returned time angle will be restricted to a single 24 hour interval.
| value | [s] the angle defined as seconds of time. |
References TimeAngle(), supernovas::Unit::hour_angle, and supernovas::Validating::is_valid().
|
overridevirtual |
Provides a DDD:MM:SS.SSS representation of the angle with the specified separators and decimal places for the arc seconds.
| separator | the type of separators / unit markers used to distinguish the degree, minute, and second components. |
| decimals | [0:9] the number of decimal places to print for the arc seconds component. |
Reimplemented from supernovas::Angle.
References hours(), and novas_print_hms().
Referenced by supernovas::CatalogSource::to_string(), and supernovas::Equatorial::to_string().
|
static |
Returns a reference to a statically defined time-angle that represents a zero angle.
References TimeAngle().