![]() |
SuperNOVAS C++ API v1.6
High-precision C/C++ astrometry library
|
Spherical coordinates (longitude, latitude), representing a direction on sky. More...
#include <supernovas.h>
Public Member Functions | |
| Spherical (const Angle &longitude, const Angle &latitude) | |
| Instantiates new spherical coordinates with the specified components. | |
| Spherical (const std::string &longitude, const std::string &latitude) | |
| Instantiates spherical coordinates with the specified string representations of the longitude and latitude coordinates, optionally specifying a system and a distance if needed. | |
| Spherical (double longitude_rad, double latitude_rad) | |
| Instantiates new spherical coordinates with the specified components. | |
| virtual | ~Spherical () |
| const Angle & | latitude () const |
| Returns the latitude coordinate as an angle. | |
| const Angle & | longitude () const |
| Returns the longitude coordinate as an angle. | |
| virtual std::string | to_string (enum novas_separator_type separator=NOVAS_SEP_UNITS_AND_SPACES, int decimals=3) const |
| Returns a string representation of these spherical coordinates in DMS format, optionally specifying the type of separator to use and the precision to print. | |
| Position | xyz (const Coordinate &distance) const |
| Returns the cartesian position vector corresponding to these spherical coordinates. | |
| 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(). | |
Protected Member Functions | |
| Spherical () | |
| Instantiates invalid spherical coordinates. | |
| Angle | distance_to (const Spherical &other) const |
| Returns the angular distance of these spherical coordiantes to/from the specified other spherical coordinates. | |
| bool | equals (const Spherical &other, double precision) const |
| Protected Member Functions inherited from supernovas::Validating | |
| Validating () | |
| dummy constructor; | |
Additional Inherited Members | |
| Protected Attributes inherited from supernovas::Validating | |
| bool | _valid = false |
| the state variable. | |
Spherical coordinates (longitude, latitude), representing a direction on sky.
|
inlineprotected |
Instantiates invalid spherical coordinates.
Referenced by supernovas::Ecliptic::Ecliptic(), supernovas::Ecliptic::Ecliptic(), supernovas::Equatorial::Equatorial(), supernovas::Equatorial::Equatorial(), supernovas::Equatorial::Equatorial(), supernovas::Galactic::Galactic(), supernovas::Galactic::Galactic(), supernovas::Galactic::Galactic(), supernovas::Horizontal::Horizontal(), supernovas::Horizontal::Horizontal(), Spherical(), Spherical(), distance_to(), and equals().
|
inlinevirtual |
| supernovas::Spherical::Spherical | ( | double | longitude_rad, |
| double | latitude_rad ) |
Instantiates new spherical coordinates with the specified components.
| longitude_rad | [rad] longitude coordinate |
| latitude_rad | [rad] latitude coordinate |
References supernovas::Validating::_valid, and supernovas::Constant::half_pi.
Instantiates new spherical coordinates with the specified components.
References Spherical(), latitude(), and longitude().
| supernovas::Spherical::Spherical | ( | const std::string & | lon, |
| const std::string & | lat ) |
Instantiates spherical coordinates with the specified string representations of the longitude and latitude coordinates, optionally specifying a system and a distance if needed.
After instantiation, you should check that the resulting coordinates are valid, e.g. as:
| lon | string representation of the longitude coordinate in DMS or a decimnal degrees. |
| lat | string representation of the declination coordinate as DMS or decimal degrees. |
References Spherical().
Returns the angular distance of these spherical coordiantes to/from the specified other spherical coordinates.
| other | the reference spherical coordinates |
References Spherical(), supernovas::Angle::deg(), supernovas::Unit::deg, supernovas::Validating::is_valid(), and novas_sep().
Referenced by supernovas::Ecliptic::distance_to(), supernovas::Equatorial::distance_to(), supernovas::Galactic::distance_to(), supernovas::Horizontal::distance_to(), and equals().
|
inlineprotected |
References Spherical(), distance_to(), and supernovas::Angle::rad().
Referenced by supernovas::Ecliptic::equals(), supernovas::Equatorial::equals(), supernovas::Galactic::equals(), and supernovas::Horizontal::equals().
| const Angle & supernovas::Spherical::latitude | ( | ) | const |
Returns the latitude coordinate as an angle.
Referenced by supernovas::Ecliptic::Ecliptic(), supernovas::Ecliptic::Ecliptic(), supernovas::Galactic::Galactic(), supernovas::Galactic::Galactic(), Spherical(), supernovas::Equatorial::dec(), supernovas::Horizontal::elevation(), supernovas::Orbital::pole(), supernovas::OrbitalSystem::pole(), supernovas::Horizontal::to_apparent(), supernovas::Ecliptic::to_equatorial(), supernovas::Galactic::to_equatorial(), supernovas::Equatorial::to_galactic(), supernovas::Horizontal::to_refracted(), supernovas::Horizontal::to_unrefracted(), and supernovas::Horizontal::zenith_angle().
| const Angle & supernovas::Spherical::longitude | ( | ) | const |
Returns the longitude coordinate as an angle.
Referenced by supernovas::Ecliptic::Ecliptic(), supernovas::Ecliptic::Ecliptic(), supernovas::Galactic::Galactic(), supernovas::Galactic::Galactic(), Spherical(), supernovas::Horizontal::azimuth(), supernovas::Orbital::pole(), supernovas::OrbitalSystem::pole(), supernovas::Equatorial::ra(), supernovas::Horizontal::to_apparent(), supernovas::Ecliptic::to_equatorial(), supernovas::Galactic::to_equatorial(), supernovas::Equatorial::to_galactic(), supernovas::Horizontal::to_refracted(), and supernovas::Horizontal::to_unrefracted().
|
virtual |
Returns a string representation of these spherical coordinates in DMS format, optionally specifying the type of separator to use and the precision to print.
| separator | (optional) the type of separators to use for the DMS representations of the components (default: units and spaces). |
| decimals | (optional) the number of decimal places to print for the seconds (default: 3) |
Reimplemented in supernovas::Ecliptic, supernovas::Equatorial, supernovas::Galactic, and supernovas::Horizontal.
References supernovas::Angle::to_string().
Referenced by supernovas::Ecliptic::to_string(), supernovas::Galactic::to_string(), and supernovas::Horizontal::to_string().
| Position supernovas::Spherical::xyz | ( | const Coordinate & | distance | ) | const |
Returns the cartesian position vector corresponding to these spherical coordinates.
References supernovas::Validating::is_valid(), and supernovas::Coordinate::m().