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.
bool | equals (const OrbitalSystem &other) const
| Checks if this orbital system matches another within typical tolerances.
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.
bool | operator!= (const OrbitalSystem &other) const
| Checks if this orbital system differs from another, given typical tolerances.
bool | operator== (const OrbitalSystem &other) const
| Checks if this orbital system matches another within typical tolerances.
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' state 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.

## 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, the best practice is to fully define the orbital first, before using it to define orbitals, or an immutable const copy of it for referencing in parallel threads.

Since
  1.6

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.

Since
  1.6

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.

Since
  1.6

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.

Since
  1.6

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

  center | the major planet, Sun, Moon, or barycenter position

Returns
  a new ecliptic orbital system around the specified center position.

Since
  1.6

See also
  equatorial(), orientation(), pole()

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

Referenced by ecliptic().

## equals()

bool supernovas::OrbitalSystem::equals | ( | const OrbitalSystem & | other | ) | const

Checks if this orbital system matches another within typical tolerances.

Two orbital system are considered equal, if they are defined with respect to the same reference plane, around the same major planet (or Solar-system position), and have the obliquity and ascending node (if obliquity is non-zero) to within 1 μas.

Note, that an orbital system may not equal itself if it contains NAN or infinite components.

Parameters

  other | the other orbital system

Returns
  true if this orbital system and the other describe essentially the same system, within tolerances, or else false.

Since
  1.7

See also
  operator==(), operator!=()

References equals(), and novas_equals_orbsys().

Referenced by equals(), operator!=(), and operator==().

## 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

  center | the major planet, Sun, Moon, or barycenter position

Returns
  a new equatorial orbital system around the specified center position.

Since
  1.6

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.

The returned orbital system may be invalid if the argument is NULL or if the C orbital system is ill-defined. It's best practice to call is_valid() on the returned orbital system instance after this call to check that the supplied parameters do in fact define a valid orbital system.

Parameters

  system | The NOVAS C orbital system data structure (copied)

Returns
  A new orbital system with that copies the parameters of the argument.

Since
  1.6

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.

Since
  1.6

See also
  ascending_node(), pole(), system_type()

References obliquity().

Referenced by obliquity(), and orientation().

## operator!=()

bool supernovas::OrbitalSystem::operator!= | ( | const OrbitalSystem & | other | ) | const

Checks if this orbital system differs from another, given typical tolerances.

Same as !equals().

Parameters

  other | the other orbital system

Returns
  true if this orbital system and the other descrive distinct systems, given typical tolerances, or else false.

Since
  1.7

See also
  equals(), operator!=()

References equals(), and operator!=().

Referenced by operator!=().

## operator==()

bool supernovas::OrbitalSystem::operator== | ( | const OrbitalSystem & | other | ) | const

Checks if this orbital system matches another within typical tolerances.

Same as equals().

Parameters

  other | the other orbital system

Returns
  true if this orbital system and the other describe essentially the same system, within tolerances, or else false.

Since
  1.7

See also
  equals(), operator!=()

References equals(), and operator==().

Referenced by operator==().

## 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_time | reference time of the orbital parameters.
  semi_major | semi-major axis (circular radius) of the orbit
  mean_anomaly | Mean anomaly (circular longitude) of the object at the reference time, in the orbital system.
  period | orbital period.

Since
  1.6

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.

Since
  1.6

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

  obliquity | orbital system's obliquity relative to equator or ecliptic
  ascending_node | ascending node of orbital system from the vernal equinox
  system | (optional) the definition of the equinox to assume (default: ICRS).

Returns
  itself

Since
  1.6

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

Since
  1.6

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.

Since
  1.6

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

  longitude | longitude of orbital system pole in reference plane.
  latitude | latitude of orbital system pole in reference plane.
  system | (optional) the definition of the equinox to assume (default: ICRS).

Returns
  itself

Since
  1.6

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

  coords | equatorial or ecliptic coordinates of the orbital system's pole.
  system | (optional) the definition of the equinox to assume (default: ICRS).

Returns
  itself

Since
  1.6

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

Since
  1.6

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.

Since
  1.6

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.

Since
  1.6

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

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