SuperNOVAS C++ API v1.6
High-precision C/C++ astrometry library
Loading...
Searching...
No Matches
supernovas::OrbitalSystem Class Reference

Orbital system for Keplerian orbitals, defining the orbital plane and orientation, and the central body (such as the Sun or a planet), around which the Keplerian orbital is to be defined. More...

#include <supernovas.h>

Inheritance diagram for supernovas::OrbitalSystem:

Public Member Functions

const novas_orbital_system_novas_orbital_system () const
 (primarily for internal use) Returns the underlying NOVAS C data structure, which defines the orbital system.
Angle ascending_node () const
 Returns the angle of the orbital system's ascending node relative to the vernal equinox on the reference plane (equatorial or ecliptic) relative to which the orbital system was specified.
Planet center () const
 Returns the major planet (including the Sun, Moon, SSB, EMB, and Pluto system barycenter), which is the center of the orbits that are defined in this orbital system.
Angle obliquity () const
 Returns the obliquity of this orbital system, relative to the reference plane (equatorial or ecliptic) in which this orbital system was specified.
Orbital orbit (const Time &ref_time, const Coordinate &semi_major, const Angle &mean_anomaly, const Interval &period) const
 Instantiates a new Keplerian orbital in this orbital system and the basic circular orbital parameters.
Orbital orbit (double jd_tdb, double semi_major_m, double mean_anomaly_rad, double period_s) const
 Instantiates a new Keplerian orbital in this orbital system and the basic circular orbital parameters.
OrbitalSystem & orientation (const Angle &obliquity, const Angle &node, const Equinox &system=Equinox::icrs())
 Defines the orientation this orbital system relative to the reference plane (equatorial or ecliptic), relative to which the system is defined.
OrbitalSystem & orientation (double obliquity_rad, double node_rad, const Equinox &system=Equinox::icrs())
 Defines the orientation of this orbital system relative to the reference plane (equatorial or ecliptic), relative to which the system is defined.
Spherical pole () const
 Returns the orbital system's pole in the reference plane (equatorial or ecliptic), relative to which the system is specified.
OrbitalSystem & pole (const Angle &longitude, const Angle &latitude, const Equinox &system=Equinox::icrs())
 Defines the pole this orbital system relative to the reference plane (equatorial or ecliptic), relative to which the system is defined.
OrbitalSystem & pole (const Spherical &coords, const Equinox &system=Equinox::icrs())
 Defines the pole this orbital system relative to the reference plane (equatorial or ecliptic), relative to which the system is defined.
OrbitalSystem & pole (double longitude_rad, double latitude_rad, const Equinox &system=Equinox::icrs())
 Defines the pole this orbital system relative to the reference plane (equatorial or ecliptic), relative to which the system is defined.
enum novas_reference_system system_type () const
 Returns the coordinate reference system type, in which the orbital system is defined.
std::string to_string () const
 Returns a human-readable description of this orbital system.
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 OrbitalSystem ecliptic (const Planet &center=Planet::sun())
 Returns a new ecliptic orbital system around the specified major planet, Sun, Moon, or barycenter position.
static OrbitalSystem equatorial (const Planet &center=Planet::sun())
 Returns a new equarial orbital system around the specified major planet, Sun, Moon, or barycenter position.
static OrbitalSystem from_novas_orbital_system (const novas_orbital_system *system)
 (primarily for internal use) Constructs a new orbital system by copying the specified NOVAS C orbital system data structure, or std::nullopt if the argument is NULL.

Additional Inherited Members

Protected Member Functions inherited from supernovas::Validating
 Validating ()
 dummy constructor;
Protected Attributes inherited from supernovas::Validating
bool _valid = false
 the state variable.

Detailed Description

Orbital system for Keplerian orbitals, defining the orbital plane and orientation, and the central body (such as the Sun or a planet), around which the Keplerian orbital is to be defined.

NOTES:

  1. This class uses a builder pattern to populate add the parameters that define the orbital system, bit-by-bit, as needed. As such, this class is mutable, unlike most SuperNOVAS classes. You should avoid using the builder functions in a multi-threaded environment. The best practice is to fully define the orbital first, before using it to define orbitals, or referencing it in parallel threads unmodified.
See also
Orbital

Member Function Documentation

◆ _novas_orbital_system()

const novas_orbital_system * supernovas::OrbitalSystem::_novas_orbital_system ( ) const

(primarily for internal use) Returns the underlying NOVAS C data structure, which defines the orbital system.

Returns
a pointer to the NOVAS C structure used internally to define the orbital system.

References _novas_orbital_system().

Referenced by _novas_orbital_system().

◆ ascending_node()

Angle supernovas::OrbitalSystem::ascending_node ( ) const

Returns the angle of the orbital system's ascending node relative to the vernal equinox on the reference plane (equatorial or ecliptic) relative to which the orbital system was specified.

Returns
the ascending node's distance from the vernal equinox in the orbital reference plane.
See also
obliquity(), pole(), system_type()

References ascending_node().

Referenced by ascending_node(), and orientation().

◆ center()

Planet supernovas::OrbitalSystem::center ( ) const

Returns the major planet (including the Sun, Moon, SSB, EMB, and Pluto system barycenter), which is the center of the orbits that are defined in this orbital system.

Returns
the Solar-system body or barycenter position around which orbits are defined in this system.

References center().

Referenced by center(), ecliptic(), and equatorial().

◆ ecliptic()

OrbitalSystem supernovas::OrbitalSystem::ecliptic ( const Planet & center = Planet::sun())
static

Returns a new ecliptic orbital system around the specified major planet, Sun, Moon, or barycenter position.

The new orbital system is assumed to be aligned with the ecliptic plane and coordinate system, until its orientation / pole is defined otherwise.

Parameters
centerthe major planet, Sun, Moon, or barycenter position
Returns
a new ecliptic orbital system around the specified center position.
See also
equatorial(), orientation(), pole()

References center(), ecliptic(), and NOVAS_ECLIPTIC_PLANE.

Referenced by ecliptic().

◆ equatorial()

OrbitalSystem supernovas::OrbitalSystem::equatorial ( const Planet & center = Planet::sun())
static

Returns a new equarial orbital system around the specified major planet, Sun, Moon, or barycenter position.

The new orbital system is assumed to be aligned with the equatorial plane and coordinate system, until its orientation / pole is defined otherwise.

Parameters
centerthe major planet, Sun, Moon, or barycenter position
Returns
a new equatorial orbital system around the specified center position.
See also
ecliptic(), orientation(), pole()

References center(), equatorial(), and NOVAS_EQUATORIAL_PLANE.

Referenced by equatorial().

◆ from_novas_orbital_system()

OrbitalSystem supernovas::OrbitalSystem::from_novas_orbital_system ( const novas_orbital_system * system)
static

(primarily for internal use) Constructs a new orbital system by copying the specified NOVAS C orbital system data structure, or std::nullopt if the argument is NULL.

It's best practice to call is_valid() after to check that the supplied parameters do in fact define a valid orbital system.

Parameters
systemThe NOVAS C orbital system data structure (copied)
Returns
A new orbital system with that copies the parameters of the argument.
See also
is_valid()

References from_novas_orbital_system(), and supernovas::Validating::is_valid().

Referenced by from_novas_orbital_system(), and supernovas::Orbital::system().

◆ obliquity()

Angle supernovas::OrbitalSystem::obliquity ( ) const

Returns the obliquity of this orbital system, relative to the reference plane (equatorial or ecliptic) in which this orbital system was specified.

Returns
the obliquity of the orbital system relative to the reference plane.
See also
ascending_node(), pole(), system_type()

References obliquity().

Referenced by obliquity(), and orientation().

◆ orbit() [1/2]

Orbital supernovas::OrbitalSystem::orbit ( const Time & ref_time,
const Coordinate & semi_major,
const Angle & mean_anomaly,
const Interval & period ) const

Instantiates a new Keplerian orbital in this orbital system and the basic circular orbital parameters.

You can further specify the parameters for elliptical orbits using a builder pattern after instantiation.

Parameters
ref_timereference time of the orbital parameters.
semi_majorsemi-major axis (circular radius) of the orbit
mean_anomalyMean anomaly (circular longitude) of the object at the reference time, in the orbital system.
periodorbital period.
See also
from_mean_motion(), eccentricity(), inclination(), pole(), node_period(), node_rate() apsis_period(), apsis_rate()

References supernovas::Time::jd(), supernovas::Coordinate::m(), NOVAS_TDB, orbit(), supernovas::Angle::rad(), and supernovas::Interval::seconds().

◆ orbit() [2/2]

Orbital supernovas::OrbitalSystem::orbit ( double jd_tdb,
double semi_major_m,
double mean_anomaly_rad,
double period_s ) const

Instantiates a new Keplerian orbital in this orbital system and the basic circular orbital parameters.

You can further specify the parameters for elliptical orbits using a builder pattern after instantiation.

Parameters
jd_tdb[day] reference date of the orbital parameters as a Barycentric Dynamical Time (TDB) based Julian date
semi_major_m[m] semi-major axis (circular radius) of the orbit
mean_anomaly_rad[rad] Mean anomaly (circular longitude) of the object at the reference time, in the orbital system.
period_s[s] orbital period.
See also
from_mean_motion(), eccentricity(), inclination(), pole(), node_period(), node_rate() apsis_period(), apsis_rate()

References orbit().

Referenced by orbit(), and orbit().

◆ orientation() [1/2]

OrbitalSystem & supernovas::OrbitalSystem::orientation ( const Angle & obliquity,
const Angle & ascending_node,
const Equinox & system = Equinox::icrs() )

Defines the orientation this orbital system relative to the reference plane (equatorial or ecliptic), relative to which the system is defined.

Parameters
obliquityorbital system's obliquity relative to equator or ecliptic
ascending_nodeascending node of orbital system from the vernal equinox
system(optional) the definition of the equinox to assume (default: ICRS).
Returns
itself
See also
pole(), obliquity(), ascending_node()

References ascending_node(), obliquity(), and orientation().

◆ orientation() [2/2]

OrbitalSystem & supernovas::OrbitalSystem::orientation ( double obliquity_rad,
double ascending_node_rad,
const Equinox & system = Equinox::icrs() )

Defines the orientation of this orbital system relative to the reference plane (equatorial or ecliptic), relative to which the system is defined.

Parameters
obliquity_rad[rad] orbital system's obliquity relative to equator or ecliptic
ascending_node_rad[rad] ascending node of orbital system from the vernal equinox
system(optional) the definition of the equinox to assume (default: ICRS).
Returns
itself
See also
pole(), obliquity(), ascending_node()

References supernovas::Validating::_valid, supernovas::Validating::is_valid(), NOVAS_PLANETS, orientation(), and supernovas::Equinox::system_type().

Referenced by orientation(), orientation(), and pole().

◆ pole() [1/4]

Spherical supernovas::OrbitalSystem::pole ( ) const

Returns the orbital system's pole in the reference plane (equatorial or ecliptic), relative to which the system is specified.

Returns
The spherical location of the orbital system pole, in the reference plane.
See also
system_type(), obliquity(), ascending_node()

References supernovas::Constant::half_pi, and pole().

Referenced by pole(), pole(), pole(), and pole().

◆ pole() [2/4]

OrbitalSystem & supernovas::OrbitalSystem::pole ( const Angle & longitude,
const Angle & latitude,
const Equinox & system = Equinox::icrs() )

Defines the pole this orbital system relative to the reference plane (equatorial or ecliptic), relative to which the system is defined.

Parameters
longitudelongitude of orbital system pole in reference plane.
latitudelatitude of orbital system pole in reference plane.
system(optional) the definition of the equinox to assume (default: ICRS).
Returns
itself
See also
orientation(), obliquity(), ascending_node()

References pole(), and supernovas::Angle::rad().

◆ pole() [3/4]

OrbitalSystem & supernovas::OrbitalSystem::pole ( const Spherical & coords,
const Equinox & system = Equinox::icrs() )

Defines the pole this orbital system relative to the reference plane (equatorial or ecliptic), relative to which the system is defined.

Parameters
coordsequatorial or ecliptic coordinates of the orbital system's pole.
system(optional) the definition of the equinox to assume (default: ICRS).
Returns
itself
See also
pole(), obliquity(), ascending_node()

References supernovas::Spherical::latitude(), supernovas::Spherical::longitude(), and pole().

◆ pole() [4/4]

OrbitalSystem & supernovas::OrbitalSystem::pole ( double longitude_rad,
double latitude_rad,
const Equinox & system = Equinox::icrs() )

Defines the pole this orbital system relative to the reference plane (equatorial or ecliptic), relative to which the system is defined.

Parameters
longitude_rad[rad] longitude of orbital system pole in reference plane.
latitude_rad[rad] latitude of orbital system pole in reference plane.
system(optional) the definition of the equinox to assume (default: ICRS).
Returns
itself
See also
orientation(), obliquity(), ascending_node()

References supernovas::Constant::half_pi, supernovas::Validating::is_valid(), orientation(), and pole().

◆ system_type()

enum novas_reference_system supernovas::OrbitalSystem::system_type ( ) const

Returns the coordinate reference system type, in which the orbital system is defined.

Returns
the coordinate reference system type used for definining this orbital system.
See also
obliquity(), ascending_node(), pole(),

References system_type().

Referenced by system_type().

◆ to_string()

std::string supernovas::OrbitalSystem::to_string ( ) const

Returns a human-readable description of this orbital system.

Returns
a string describing this orbital system.

References supernovas::Unit::deg, supernovas::Source::name(), NOVAS_ECLIPTIC_PLANE, and to_string().

Referenced by supernovas::Orbital::to_string(), and to_string().