Skip to content

Class astrea::astro::CelestialBody

ClassList > astrea > astro > CelestialBody

CelestialBody class represents a celestial body in an astrodynamics system.

  • #include <CelestialBody.hpp>

Inherited by the following classes: astrea::astro::planetary_bodies::Callisto, astrea::astro::planetary_bodies::Deimos, astrea::astro::planetary_bodies::Earth, astrea::astro::planetary_bodies::Europa, astrea::astro::planetary_bodies::Ganymede, astrea::astro::planetary_bodies::Iapetus, astrea::astro::planetary_bodies::Io, astrea::astro::planetary_bodies::Jupiter, astrea::astro::planetary_bodies::Mars, astrea::astro::planetary_bodies::Mercury, astrea::astro::planetary_bodies::Moon, astrea::astro::planetary_bodies::Neptune, astrea::astro::planetary_bodies::Oberon, astrea::astro::planetary_bodies::Phobos, astrea::astro::planetary_bodies::Rhea, astrea::astro::planetary_bodies::Saturn, astrea::astro::planetary_bodies::Sun, astrea::astro::planetary_bodies::Titan, astrea::astro::planetary_bodies::Titania, astrea::astro::planetary_bodies::Triton, astrea::astro::planetary_bodies::Uranus, astrea::astro::planetary_bodies::Venus

Public Functions

Type Name
CelestialBody () = default
Default constructor for CelestialBody .
constexpr CelestialBody (const CelestialBodyParameters & data)
Constructs a CelestialBody from individual parameters.
CelestialBody (const CelestialBody & other) = default
Copy constructor for CelestialBody .
virtual Density find_atmospheric_density (const Date & date, const Distance & altitude) const
Finds the atmospheric density at a given date and state.
constexpr const Angle & get_axial_tilt () const
Get the axial tilt of the celestial body.
constexpr const Distance & get_crash_radius () const
Get the crash radius of the celestial body.
constexpr const Unitless & get_eccentricity () const
Get the eccentricity of the celestial body.
constexpr const BodyUnitlessPerTime & get_eccentricity_rate () const
Get the eccentricity rate of the celestial body.
constexpr const Distance & get_equitorial_radius () const
Get the equatorial radius of the celestial body.
constexpr const Angle & get_inclination () const
Get the inclination of the celestial body.
constexpr const BodyAngularRate & get_inclination_rate () const
Get the inclination rate of the celestial body.
constexpr const Unitless & get_j2 () const
Get the J2 gravitational coefficient of the celestial body.
constexpr const Unitless & get_j3 () const
Get the J3 gravitational coefficient of the celestial body.
Keplerian get_keplerian_elements_at (const Date & date) const
Get the keplerian elements of the celestial body at a specific date using a linear approximation.
constexpr const Angle & get_longitude_of_perigee () const
Get the longitude of perigee of the celestial body.
constexpr const BodyAngularRate & get_longitude_of_perigee_rate () const
Get the longitude of perigee rate of the celestial body.
constexpr const Mass & get_mass () const
Get the mass of the celestial body.
constexpr const Angle & get_mean_anomaly () const
Get the mean anomaly of the celestial body.
constexpr const Angle & get_mean_longitude () const
Get the mean longitude of the celestial body.
constexpr const BodyAngularRate & get_mean_longitude_rate () const
Get the mean longitude rate of the celestial body.
constexpr const GravParam & get_mu () const
Get the gravitational parameter (mu) of the celestial body.
constexpr const std::string & get_name () const
Get the name of the celestial body.
constexpr const CelestialBodyId & get_parent () const
Get the parent celestial body.
constexpr const Distance & get_polar_radius () const
Get the polar radius of the celestial body.
virtual CartesianVector< Distance, frames::solar_system_barycenter::icrf > get_position_at (const Date & date) const
Get the position of the celestial body at a specific date in the ICRF frame.
constexpr const Angle & get_right_ascension () const
Get the right ascension of the celestial body.
constexpr const BodyAngularRate & get_right_ascension_rate () const
Get the right ascension rate of the celestial body.
constexpr const AngularRate & get_rotation_rate () const
Get the rotation rate of the celestial body.
constexpr const Distance & get_semimajor () const
Get the semimajor axis of the celestial body.
constexpr const InterplanetaryVelocity & get_semimajor_rate () const
Get the semimajor axis rate of the celestial body.
constexpr const Time & get_sidereal_period () const
Get the sidereal period of the celestial body.
constexpr const Distance & get_sphere_of_influence () const
Get the sphere of influence of the celestial body.
Angle get_true_anomaly () const
Get the true anomaly of the celestial body.
constexpr const CelestialBodyType & get_type () const
Get the type of the celestial body.
constexpr bool operator== (const CelestialBody & other) const
Equality operator for CelestialBody .
virtual ~CelestialBody () = default
Default destructor for CelestialBody .

Public Static Functions

Type Name
constexpr CelestialBodyId get_id ()
Get the parent celestial body.

Protected Types

Type Name
typedef std::tuple< mp_units::quantity< mp_units::angular::unit_symbols::rad/(JulianCentury *JulianCentury)>, mp_units::quantity< mp_units::angular::unit_symbols::rad >, mp_units::quantity< mp_units::angular::unit_symbols::rad >, mp_units::quantity< mp_units::angular::unit_symbols::rad/JulianCentury > > CoefficientPack
Type alias for a tuple of linear expansion coefficients.

Protected Attributes

Type Name
Angle _axialTilt
Axial tilt of the celestial body.
Distance _crashRadius
Crash radius of the celestial body.
Unitless _eccentricity
Eccentricity.
BodyUnitlessPerTime _eccentricityRate
Rate of change of the eccentricity.
Distance _equitorialRadius
Equatorial radius of the celestial body.
Angle _inclination
Inclination.
BodyAngularRate _inclinationRate
Rate of change of the inclination.
Unitless _j2
J2 gravitational coefficient of the celestial body.
Unitless _j3
J3 gravitational coefficient of the celestial body.
Angle _longitudeOfPerigee
Argument of perigee.
BodyAngularRate _longitudeOfPerigeeRate
Rate of change of the longitude of perigee.
Mass _mass
Mass of the celestial body.
Angle _meanAnomaly
Mean anomaly.
Angle _meanLongitude
Mean longitude.
BodyAngularRate _meanLongitudeRate
Rate of change of the mean longitude.
GravParam _mu
Gravitational parameter (mu) of the celestial body.
std::string _name
Name of the celestial body.
CelestialBodyId _parent
Parent celestial body.
GravParam _parentMu
Gravitational parameter of the parent celestial body, if any.
Distance _polarRadius
Polar radius of the celestial body.
Date _referenceDate
Reference date for the celestial body data.
Angle _rightAscension
Right ascension.
BodyAngularRate _rightAscensionRate
Rate of change of the right ascension.
AngularRate _rotationRate
Rotation rate of the celestial body.
Distance _semimajorAxis
Semimajor axis.
InterplanetaryVelocity _semimajorAxisRate
Rate of change of the semimajor axis.
Time _siderealPeriod
Sidereal period of the celestial body.
Distance _sphereOfInfluence
Crash radius of the celestial body.
Angle _trueAnomaly
True anomaly.
CelestialBodyType _type
Type of the celestial body.

Protected Static Attributes

Type Name
constexpr double _COEFF_ZERO_FACTOR = 1.0

Protected Functions

Type Name
const auto get_chebyshev_table_coefficients (const Date & date) const
Get the Chebyshev polynomial coefficients for the celestial body at a specific date.
virtual constexpr CoefficientPack get_linear_expansion_coefficients () const
Get the linear expansion coefficients for the celestial body's orbital elements.
CartesianVector< Distance, Frame_T > get_position_at_impl (const Date & date) const
Get the position of the celestial body at a specific date in a specified frame using Chebyshev polynomials.
CartesianVector< Velocity, Frame_T > get_velocity_at_impl (const Date & date) const
Get the velocity of the celestial body at a specific date in a specified frame using Chebyshev polynomials.

Public Functions Documentation

function CelestialBody [1/3]

Default constructor for CelestialBody .

astrea::astro::CelestialBody::CelestialBody () = default


function CelestialBody [2/3]

Constructs a CelestialBody from individual parameters.

inline constexpr astrea::astro::CelestialBody::CelestialBody (
    const CelestialBodyParameters & data
) 

Parameters:


function CelestialBody [3/3]

Copy constructor for CelestialBody .

astrea::astro::CelestialBody::CelestialBody (
    const CelestialBody & other
) = default

Parameters:


function find_atmospheric_density

Finds the atmospheric density at a given date and state.

virtual Density astrea::astro::CelestialBody::find_atmospheric_density (
    const Date & date,
    const Distance & altitude
) const

Parameters:

  • date The date at which to find the atmospheric density.
  • state The Cartesian state vector at which to find the atmospheric density.

Returns:

Density The atmospheric density at the specified date and state.

Note:

Assume that most bodies have no significant atmosphere. Assume that the atmosphere of the gas giants is defined by their radii, e.g. outside of their equitorial radius, they have no noticible atmosphere and inside that radius, the object will crash.


function get_axial_tilt

Get the axial tilt of the celestial body.

inline constexpr const Angle & astrea::astro::CelestialBody::get_axial_tilt () const

Returns:

const Angle& Reference to the axial tilt of the celestial body.


function get_crash_radius

Get the crash radius of the celestial body.

inline constexpr const Distance & astrea::astro::CelestialBody::get_crash_radius () const

Returns:

const Distance& Reference to the crash radius of the celestial body.


function get_eccentricity

Get the eccentricity of the celestial body.

inline constexpr const Unitless & astrea::astro::CelestialBody::get_eccentricity () const

Returns:

const Unitless& Reference to the eccentricity of the celestial body.


function get_eccentricity_rate

Get the eccentricity rate of the celestial body.

inline constexpr const BodyUnitlessPerTime & astrea::astro::CelestialBody::get_eccentricity_rate () const

Returns:

const BodyUnitlessPerTime& Reference to the eccentricity rate of the celestial body.


function get_equitorial_radius

Get the equatorial radius of the celestial body.

inline constexpr const Distance & astrea::astro::CelestialBody::get_equitorial_radius () const

Returns:

const Distance& Reference to the equatorial radius of the celestial body.


function get_inclination

Get the inclination of the celestial body.

inline constexpr const Angle & astrea::astro::CelestialBody::get_inclination () const

Returns:

const Angle& Reference to the inclination of the celestial body.


function get_inclination_rate

Get the inclination rate of the celestial body.

inline constexpr const BodyAngularRate & astrea::astro::CelestialBody::get_inclination_rate () const

Returns:

const BodyAngularRate& Reference to the inclination rate of the celestial body.


function get_j2

Get the J2 gravitational coefficient of the celestial body.

inline constexpr const Unitless & astrea::astro::CelestialBody::get_j2 () const

Returns:

const Unitless& Reference to the J2 coefficient of the celestial body.


function get_j3

Get the J3 gravitational coefficient of the celestial body.

inline constexpr const Unitless & astrea::astro::CelestialBody::get_j3 () const

Returns:

const Unitless& Reference to the J3 coefficient of the celestial body.


function get_keplerian_elements_at

Get the keplerian elements of the celestial body at a specific date using a linear approximation.

Keplerian astrea::astro::CelestialBody::get_keplerian_elements_at (
    const Date & date
) const

Parameters:

  • date The date at which to get the state of the celestial body.

Returns:

Keplerian The approximate Keplerian elements of the celestial body at the specified date.


function get_longitude_of_perigee

Get the longitude of perigee of the celestial body.

inline constexpr const Angle & astrea::astro::CelestialBody::get_longitude_of_perigee () const

Returns:

const Angle& Reference to the longitude of perigee of the celestial body.


function get_longitude_of_perigee_rate

Get the longitude of perigee rate of the celestial body.

inline constexpr const BodyAngularRate & astrea::astro::CelestialBody::get_longitude_of_perigee_rate () const

Returns:

const BodyAngularRate& Reference to the longitude of perigee rate of the celestial body.


function get_mass

Get the mass of the celestial body.

inline constexpr const Mass & astrea::astro::CelestialBody::get_mass () const

Returns:

const Mass& Reference to the mass of the celestial body.


function get_mean_anomaly

Get the mean anomaly of the celestial body.

inline constexpr const Angle & astrea::astro::CelestialBody::get_mean_anomaly () const

Returns:

const Angle& Reference to the mean anomaly of the celestial body.


function get_mean_longitude

Get the mean longitude of the celestial body.

inline constexpr const Angle & astrea::astro::CelestialBody::get_mean_longitude () const

Returns:

const Angle& Reference to the mean longitude of the celestial body.


function get_mean_longitude_rate

Get the mean longitude rate of the celestial body.

inline constexpr const BodyAngularRate & astrea::astro::CelestialBody::get_mean_longitude_rate () const

Returns:

const BodyAngularRate& Reference to the mean longitude rate of the celestial body.


function get_mu

Get the gravitational parameter (mu) of the celestial body.

inline constexpr const GravParam & astrea::astro::CelestialBody::get_mu () const

Returns:

const GravParam& Reference to the gravitational parameter of the celestial body.


function get_name

Get the name of the celestial body.

inline constexpr const std::string & astrea::astro::CelestialBody::get_name () const

Returns:

const std::string& Reference to the name of the celestial body.


function get_parent

Get the parent celestial body.

inline constexpr const CelestialBodyId & astrea::astro::CelestialBody::get_parent () const

Returns:

const std::string& Reference to the name of the parent celestial body.


function get_polar_radius

Get the polar radius of the celestial body.

inline constexpr const Distance & astrea::astro::CelestialBody::get_polar_radius () const

Returns:

const Distance& Reference to the polar radius of the celestial body.


function get_position_at

Get the position of the celestial body at a specific date in the ICRF frame.

virtual CartesianVector < Distance, frames::solar_system_barycenter::icrf > astrea::astro::CelestialBody::get_position_at (
    const Date & date
) const

Parameters:

  • date The date at which to get the position of the celestial body.

Returns:

CartesianVector<Distance, frames::solar_system_barycenter::icrf> The position of the celestial body at the specified date.

Note:

This function is wrong. It actually returns the position in the ICRF frame, centered on the object's parent. Need to figure out how to make dynamic centers work with frames.


function get_right_ascension

Get the right ascension of the celestial body.

inline constexpr const Angle & astrea::astro::CelestialBody::get_right_ascension () const

Returns:

const Angle& Reference to the right ascension of the celestial body.


function get_right_ascension_rate

Get the right ascension rate of the celestial body.

inline constexpr const BodyAngularRate & astrea::astro::CelestialBody::get_right_ascension_rate () const

Returns:

const BodyAngularRate& Reference to the right ascension rate of the celestial body.


function get_rotation_rate

Get the rotation rate of the celestial body.

inline constexpr const AngularRate & astrea::astro::CelestialBody::get_rotation_rate () const

Returns:

const AngularRate& Reference to the rotation rate of the celestial body.


function get_semimajor

Get the semimajor axis of the celestial body.

inline constexpr const Distance & astrea::astro::CelestialBody::get_semimajor () const

Returns:

const Distance& Reference to the semimajor axis of the celestial body.


function get_semimajor_rate

Get the semimajor axis rate of the celestial body.

inline constexpr const InterplanetaryVelocity & astrea::astro::CelestialBody::get_semimajor_rate () const

Returns:

const InterplanetaryVelocity& Reference to the semimajor axis rate of the celestial body.


function get_sidereal_period

Get the sidereal period of the celestial body.

inline constexpr const Time & astrea::astro::CelestialBody::get_sidereal_period () const

Returns:

const Time& Reference to the sidereal period of the celestial body.


function get_sphere_of_influence

Get the sphere of influence of the celestial body.

inline constexpr const Distance & astrea::astro::CelestialBody::get_sphere_of_influence () const

Returns:

const Distance& Reference to the sphere of influence of the celestial body.


function get_true_anomaly

Get the true anomaly of the celestial body.

inline Angle astrea::astro::CelestialBody::get_true_anomaly () const

Returns:

const Angle& Reference to the true anomaly of the celestial body.


function get_type

Get the type of the celestial body.

inline constexpr const CelestialBodyType & astrea::astro::CelestialBody::get_type () const

Returns:

const CelestialBodyType& Reference to the type of the celestial body.


function operator==

Equality operator for CelestialBody .

inline constexpr bool astrea::astro::CelestialBody::operator== (
    const CelestialBody & other
) const

Parameters:

Returns:

true if the celestial bodies are equal, false otherwise.


function ~CelestialBody

Default destructor for CelestialBody .

virtual astrea::astro::CelestialBody::~CelestialBody () = default


Public Static Functions Documentation

function get_id

Get the parent celestial body.

static inline constexpr CelestialBodyId astrea::astro::CelestialBody::get_id () 

Returns:

const std::string& Reference to the name of the parent celestial body.


Protected Types Documentation

typedef CoefficientPack

Type alias for a tuple of linear expansion coefficients.

using astrea::astro::CelestialBody::CoefficientPack =  std::tuple< mp_units::quantity<mp_units::angular::unit_symbols::rad / (JulianCentury * JulianCentury)>, mp_units::quantity<mp_units::angular::unit_symbols::rad>, mp_units::quantity<mp_units::angular::unit_symbols::rad>, mp_units::quantity<mp_units::angular::unit_symbols::rad / JulianCentury> >;


Protected Attributes Documentation

variable _axialTilt

Axial tilt of the celestial body.

Angle astrea::astro::CelestialBody::_axialTilt;


variable _crashRadius

Crash radius of the celestial body.

Distance astrea::astro::CelestialBody::_crashRadius;


variable _eccentricity

Eccentricity.

Unitless astrea::astro::CelestialBody::_eccentricity;


variable _eccentricityRate

Rate of change of the eccentricity.

BodyUnitlessPerTime astrea::astro::CelestialBody::_eccentricityRate;


variable _equitorialRadius

Equatorial radius of the celestial body.

Distance astrea::astro::CelestialBody::_equitorialRadius;


variable _inclination

Inclination.

Angle astrea::astro::CelestialBody::_inclination;


variable _inclinationRate

Rate of change of the inclination.

BodyAngularRate astrea::astro::CelestialBody::_inclinationRate;


variable _j2

J2 gravitational coefficient of the celestial body.

Unitless astrea::astro::CelestialBody::_j2;


variable _j3

J3 gravitational coefficient of the celestial body.

Unitless astrea::astro::CelestialBody::_j3;


variable _longitudeOfPerigee

Argument of perigee.

Angle astrea::astro::CelestialBody::_longitudeOfPerigee;


variable _longitudeOfPerigeeRate

Rate of change of the longitude of perigee.

BodyAngularRate astrea::astro::CelestialBody::_longitudeOfPerigeeRate;


variable _mass

Mass of the celestial body.

Mass astrea::astro::CelestialBody::_mass;


variable _meanAnomaly

Mean anomaly.

Angle astrea::astro::CelestialBody::_meanAnomaly;


variable _meanLongitude

Mean longitude.

Angle astrea::astro::CelestialBody::_meanLongitude;


variable _meanLongitudeRate

Rate of change of the mean longitude.

BodyAngularRate astrea::astro::CelestialBody::_meanLongitudeRate;


variable _mu

Gravitational parameter (mu) of the celestial body.

GravParam astrea::astro::CelestialBody::_mu;


variable _name

Name of the celestial body.

std::string astrea::astro::CelestialBody::_name;


variable _parent

Parent celestial body.

CelestialBodyId astrea::astro::CelestialBody::_parent;


variable _parentMu

Gravitational parameter of the parent celestial body, if any.

GravParam astrea::astro::CelestialBody::_parentMu;


variable _polarRadius

Polar radius of the celestial body.

Distance astrea::astro::CelestialBody::_polarRadius;


variable _referenceDate

Reference date for the celestial body data.

Date astrea::astro::CelestialBody::_referenceDate;


variable _rightAscension

Right ascension.

Angle astrea::astro::CelestialBody::_rightAscension;


variable _rightAscensionRate

Rate of change of the right ascension.

BodyAngularRate astrea::astro::CelestialBody::_rightAscensionRate;


variable _rotationRate

Rotation rate of the celestial body.

AngularRate astrea::astro::CelestialBody::_rotationRate;


variable _semimajorAxis

Semimajor axis.

Distance astrea::astro::CelestialBody::_semimajorAxis;


variable _semimajorAxisRate

Rate of change of the semimajor axis.

InterplanetaryVelocity astrea::astro::CelestialBody::_semimajorAxisRate;


variable _siderealPeriod

Sidereal period of the celestial body.

Time astrea::astro::CelestialBody::_siderealPeriod;


variable _sphereOfInfluence

Crash radius of the celestial body.

Distance astrea::astro::CelestialBody::_sphereOfInfluence;


variable _trueAnomaly

True anomaly.

Angle astrea::astro::CelestialBody::_trueAnomaly;


variable _type

Type of the celestial body.

CelestialBodyType astrea::astro::CelestialBody::_type;


Protected Static Attributes Documentation

variable _COEFF_ZERO_FACTOR

constexpr double astrea::astro::CelestialBody::_COEFF_ZERO_FACTOR;

Protected Functions Documentation

function get_chebyshev_table_coefficients

Get the Chebyshev polynomial coefficients for the celestial body at a specific date.

template<typename Table_T>
inline const auto astrea::astro::CelestialBody::get_chebyshev_table_coefficients (
    const Date & date
) const

Template parameters:

  • Table_T The Chebyshev table type to use for interpolation.

Parameters:

  • date The date at which to get the Chebyshev coefficients.

Returns:

A tuple containing references to the x, y, and z Chebyshev coefficient vectors.


function get_linear_expansion_coefficients

Get the linear expansion coefficients for the celestial body's orbital elements.

inline virtual constexpr CoefficientPack astrea::astro::CelestialBody::get_linear_expansion_coefficients () const

Returns:

CoefficientPack A tuple containing the linear expansion coefficients.

Note:

The default implementation returns zero coefficients, indicating no perturbations. Derived classes should override this method to provide actual coefficients.


function get_position_at_impl

Get the position of the celestial body at a specific date in a specified frame using Chebyshev polynomials.

template<typename Table_T, typename Frame_T>
inline CartesianVector < Distance, Frame_T > astrea::astro::CelestialBody::get_position_at_impl (
    const Date & date
) const

Template parameters:

  • Table_T The Chebyshev table type to use for interpolation.
  • Frame_T The frame type in which to return the position.

Parameters:

  • date The date at which to get the position of the celestial body.

Returns:

CartesianVector<Distance, Frame_T> The position of the celestial body at the specified date in the specified frame.


function get_velocity_at_impl

Get the velocity of the celestial body at a specific date in a specified frame using Chebyshev polynomials.

template<typename Table_T, typename Frame_T>
inline CartesianVector < Velocity, Frame_T > astrea::astro::CelestialBody::get_velocity_at_impl (
    const Date & date
) const

Template parameters:

  • Table_T The Chebyshev table type to use for interpolation.
  • Frame_T The frame type in which to return the velocity.

Parameters:

  • date The date at which to get the velocity of the celestial body.

Returns:

CartesianVector<Velocity, Frame_T> The velocity of the celestial body at the specified date in the specified frame.



The documentation for this class was generated from the following file astrea/astro/astro/systems/CelestialBody.hpp