Astro  0.0.0
A C++ library for space dynamics
Loading...
Searching...
No Matches
Astro::OrbitalElements Namespace Reference

The namespace for the orbital elements definition and conversion.

Classes

struct  Anomaly
 Structure container for the orbital anomalies. More...
struct  Cartesian
 Structure container for the cartesian orbital elements. More...
struct  Equinoctial
 Struct container for the (modified) equinoctial orbital elements. More...
struct  Keplerian
 Structure container for the (modified) Keplerian orbital elements. More...
struct  Quaternionic
 Structure container for the quaternionic orbital elements. More...

Functions

Real nu_to_M (Real const nu, Real const e)
Real nu_to_M (Real const nu, Keplerian const &kepl)
Real nu_to_E (Real const nu, Keplerian const &kepl)
Real nu_to_L (Real const nu, Keplerian const &kepl, Factor const I)
Real M_to_E (Real M, Real const e)
Real M_to_E (Real M, Keplerian const &kepl)
Real M_to_H (Real const M, Keplerian const &kepl)
Real M_to_lambda (Real const M, Keplerian const &kepl, Factor const I)
Real E_to_nu (Real const E, Real const e)
Real E_to_nu (Real const E, Keplerian const &kepl)
Real E_to_M (Real const E, Real const e)
Real E_to_M (Real const E, Keplerian const &kepl)
Real H_to_nu (Real const H, Keplerian const &kepl)
Real H_to_M (Real const H, Keplerian const &kepl)
Real L_to_nu (Real const L, Keplerian const &kepl, Factor const I)
Real L_to_lambda (Real const L, Real const nu, Real const M)
Real lambda_to_M (Real const lambda, Keplerian const &kepl, Factor const I)
Real lambda_to_L (Real const lambda, Real const nu, Real const M)
Real cartesian_to_keplerian (Cartesian const &cart, Real const mu, Keplerian &kepl)
void keplerian_to_cartesian (Keplerian const &kepl, Real const nu, Real const mu, Cartesian &cart)
void equinoctial_to_cartesian (Equinoctial const &equi, Real const L, Real const mu, Cartesian &cart)
void keplerian_to_equinoctial (Keplerian const &kepl, Factor const I, Equinoctial &equi)
Real cartesian_to_equinoctial (Cartesian const &cart, Real const mu, Equinoctial &equi)
void equinoctial_to_cartesian (Equinoctial const &equi, Real const L, Factor const I, Real const mu, Cartesian &cart)
void equinoctial_to_keplerian (Equinoctial const &equi, Keplerian &kepl)

Function Documentation

◆ cartesian_to_equinoctial()

Real Astro::OrbitalElements::cartesian_to_equinoctial ( Cartesian const & cart,
Real const mu,
Equinoctial & equi )

Convert the cartesian state (position and velocity) vectors to the equinoctial orbital elements.

Parameters
[in]cartThe cartesian state (position and velocity) vectors.
[in]muThe gravitational parameter.
[in]IThe posigrade (+1)/retrograde (-1) factor.
[out]equiThe equinoctial orbital elements.
Returns
The true longitude \( L \).
Note
The transformation is only valid for posigrade orbits (I = +1).

◆ cartesian_to_keplerian()

Real Astro::OrbitalElements::cartesian_to_keplerian ( Cartesian const & cart,
Real const mu,
Keplerian & kepl )

Convert the cartesian state (position and velocity) vectors to the keplerian orbital elements.

Parameters
[in]cartThe cartesian state (position and velocity) vectors.
[in]muThe gravitational parameter.
[out]keplThe keplerian orbital elements.
Returns
The true anomaly \( \nu \) (rad).

◆ E_to_M() [1/2]

Real Astro::OrbitalElements::E_to_M ( Real const E,
Keplerian const & kepl )

Compute the mean anomaly \( M \) from the eccentric anomaly \( E \) as

\[ M = E - e\sin(E) \text{.} \]

Parameters
[in]EThe eccentric anomaly \( E \).
[in]keplThe keplerian orbital elements.
Returns
The true anomaly \( \nu \).

◆ E_to_M() [2/2]

Real Astro::OrbitalElements::E_to_M ( Real const E,
Real const e )

Compute the mean anomaly \( M \) from the eccentric anomaly \( E \) as

\[ M = E - e\sin(E) \text{.} \]

Parameters
[in]EThe eccentric anomaly \( E \).
[in]eThe eccentricity \( e \).
Returns
The true anomaly \( \nu \).

◆ E_to_nu() [1/2]

Real Astro::OrbitalElements::E_to_nu ( Real const E,
Keplerian const & kepl )

Compute the true anomaly \( \nu \) from the eccentric anomaly \( E \) as

\[ \tan\left(\frac{\nu - E}{2}\right) = \displaystyle\frac{\sin(E)}{\beta - \cos(E)} \text{,} \]

with \( \beta = \displaystyle\frac{1 + \sqrt{1 - e^2}}{e} \). That is equivalent to

\[ \nu = E + 2\arctan\left(\frac{\sin(E)}{\beta - \cos(E)}\right) \text{.} \]

Note
Refer to R. Broucke and P. Cefola, A note on the relations between true and eccentric anomalies in the two-body problem, Celestial Mechanics, Vol. 7, pp. 300-389, 1973.
Parameters
[in]EThe eccentric anomaly \( E \).
[in]keplThe keplerian orbital elements.
Returns
The true anomaly \( \nu \).

◆ E_to_nu() [2/2]

Real Astro::OrbitalElements::E_to_nu ( Real const E,
Real const e )

Compute the true anomaly \( \nu \) from the eccentric anomaly \( E \) as

\[ \tan\left(\frac{\nu - E}{2}\right) = \displaystyle\frac{\sin(E)}{\beta - \cos(E)} \text{,} \]

with \( \beta = \displaystyle\frac{1 + \sqrt{1 - e^2}}{e} \). That is equivalent to

\[ \nu = E + 2\arctan\left(\frac{\sin(E)}{\beta - \cos(E)}\right) \text{.} \]

Note
Refer to R. Broucke and P. Cefola, A note on the relations between true and eccentric anomalies in the two-body problem, Celestial Mechanics, Vol. 7, pp. 300-389, 1973.
Parameters
[in]EThe eccentric anomaly \( E \).
[in]eThe eccentricity \( e \).
Returns
The true anomaly \( \nu \).

◆ equinoctial_to_cartesian() [1/2]

void Astro::OrbitalElements::equinoctial_to_cartesian ( Equinoctial const & equi,
Real const L,
Factor const I,
Real const mu,
Cartesian & cart )

Convert the equinoctial orbital elements to cartesian state (position and velocity) vectors.

Parameters
[in]equiThe equinoctial orbital elements.
[in]LThe true longitude \( L \).
[in]IThe posigrade (+1)/retrograde (-1) factor.
[in]muThe gravitational parameter.
[out]cartThe cartesian state (position and velocity) vectors.

◆ equinoctial_to_cartesian() [2/2]

void Astro::OrbitalElements::equinoctial_to_cartesian ( Equinoctial const & equi,
Real const L,
Real const mu,
Cartesian & cart )

Convert the equinoctial orbital elements to the cartesian state (position and velocity) vectors.

Parameters
[in]equiThe equinoctial orbital elements.
[in]LThe true longitude \( L \).
[in]muThe gravitational parameter.
[out]cartThe cartesian state (position and velocity) vectors.

◆ equinoctial_to_keplerian()

void Astro::OrbitalElements::equinoctial_to_keplerian ( Equinoctial const & equi,
Keplerian & kepl )

Convert the equinoctial orbital elements to the keplerian orbital elements.

Parameters
[in]equiThe equinoctial orbital elements.
[in]IThe posigrade (+1)/retrograde (-1) factor.
[out]keplThe keplerian orbital elements.

◆ H_to_M()

Real Astro::OrbitalElements::H_to_M ( Real const H,
Keplerian const & kepl )

Compute the mean anomaly \( M \) from the hyperbolic anomaly \( H \) as

\[ M = e\sinh(H) - H \text{.} \]

Parameters
[in]HThe hyperbolic anomaly \( H \).
[in]keplThe keplerian orbital elements.
Returns
The mean anomaly \( M \).

◆ H_to_nu()

Real Astro::OrbitalElements::H_to_nu ( Real const H,
Keplerian const & kepl )

Compute the true anomaly \( \nu \) from the hyperbolic anomaly \( H \) as

\[ \nu = 2\arctan\left(\sqrt{\frac{e + 1}{e - 1}}\tanh\left(\frac{H}{2}\right)\right) \text{.} \]

Note
Refer to (p. 167) "An Introduction to the Mathematics and Methods of Astrodynamics" by R. H. Battin, AIAA Education Series, 1999.
Parameters
[in]HThe hyperbolic anomaly \( H \).
[in]keplThe keplerian orbital elements.
Returns
The true anomaly \( \nu \).

◆ keplerian_to_cartesian()

void Astro::OrbitalElements::keplerian_to_cartesian ( Keplerian const & kepl,
Real const nu,
Real const mu,
Cartesian & cart )

Convert the keplerian orbital elements to the cartesian state (position and velocity) vectors.

Parameters
[in]keplThe keplerian orbital elements.
[in]nuThe true anomaly \( \nu \).
[in]muThe gravitational parameter.
[out]cartThe cartesian state (position and velocity) vectors.

◆ keplerian_to_equinoctial()

void Astro::OrbitalElements::keplerian_to_equinoctial ( Keplerian const & kepl,
Factor const I,
Equinoctial & equi )

Convert the keplerian orbital elements to the equinoctial orbital elements.

Parameters
[in]keplThe keplerian orbital elements.
[in]IThe posigrade (+1)/retrograde (-1) factor.
[out]equiThe equinoctial orbital elements.

◆ L_to_lambda()

Real Astro::OrbitalElements::L_to_lambda ( Real const L,
Real const nu,
Real const M )

Compute the mean longitude \( \lambda \) from the true longitude \( L \) as

\[ \lambda = L - \nu + M \text{.} \]

Parameters
[in]LThe true longitude \( L \).
[in]nuThe true anomaly \( \nu \).
[in]MThe mean anomaly \( M \).
Returns
The mean longitude \( \lambda \).

◆ L_to_nu()

Real Astro::OrbitalElements::L_to_nu ( Real const L,
Keplerian const & kepl,
Factor const I )

Compute the true anomaly \( \nu \) from the true longitude \( L \) as

\[ \nu = L - \omega - I\Omega \text{.} \]

Parameters
[in]LThe true longitude \( L \).
[in]keplThe keplerian orbital elements.
[in]IThe posigrade (+1)/retrograde (-1) factor.
Returns
The true anomaly \( \nu \).

◆ lambda_to_L()

Real Astro::OrbitalElements::lambda_to_L ( Real const lambda,
Real const nu,
Real const M )

Compute the true longitude \( L \) from the mean longitude \( \lambda \) as

\[ L = \lambda + \nu - M \text{.} \]

Parameters
[in]lambdaThe mean longitude \( \lambda \).
[in]nuThe true anomaly \( \nu \).
[in]MThe mean anomaly \( M \).
Returns
The true longitude \( L \).

◆ lambda_to_M()

Real Astro::OrbitalElements::lambda_to_M ( Real const lambda,
Keplerian const & kepl,
Factor const I )

Compute the mean anomaly \( M \) from the mean longitude \( \lambda \) as

\[ M = \lambda - \omega - I\Omega \text{.} \]

Parameters
[in]lambdaThe mean longitude \( \lambda \).
[in]keplThe keplerian orbital elements.
[in]IThe posigrade (+1)/retrograde (-1) factor.
Returns
The mean anomaly \( M \).

◆ M_to_E() [1/2]

Real Astro::OrbitalElements::M_to_E ( Real M,
Keplerian const & kepl )

Compute the eccentric anomaly \( E \) from the mean anomaly \( M \) through a the solution of the nonlinear equation \( E = M + e\sin(E) \) for \( E \). The solution is found through a basic Newton method.

Parameters
[in]MThe mean anomaly \( M \).
[in]keplThe keplerian orbital elements.
Returns
The eccentric anomaly \( E \).

◆ M_to_E() [2/2]

Real Astro::OrbitalElements::M_to_E ( Real M,
Real const e )

Compute the eccentric anomaly \( E \) from the mean anomaly \( M \) through a the solution of the nonlinear equation \( E = M + e\sin(E) \) for \( E \). The solution is found through a basic Newton method.

Parameters
[in]MThe mean anomaly \( M \).
[in]eThe eccentricity \( e \).
Returns
The eccentric anomaly \( E \).

◆ M_to_H()

Real Astro::OrbitalElements::M_to_H ( Real const M,
Keplerian const & kepl )

Compute the mean anomaly \( M \) from the hyperbolic anomaly \( H \). \( M = e\sinh(H) - H \text{.} \). The solution is found through a basic Newton method.

Note
The mean anomaly \( M \) must not be clamped in the range \( [0, 2\pi] \)!
Parameters
[in]MThe mean anomaly \( M \).
[in]keplThe keplerian orbital elements.
Returns
The mean anomaly \( M \).

◆ M_to_lambda()

Real Astro::OrbitalElements::M_to_lambda ( Real const M,
Keplerian const & kepl,
Factor const I )

Compute the mean longitude \( \lambda \) from the mean anomaly \( M \) as

\[ \lambda = M + \omega + I\Omega \text{.} \]

Parameters
[in]MThe mean anomaly \( M \).
[in]keplThe keplerian orbital elements.
[in]IThe posigrade (+1)/retrograde (-1) factor.
Returns
The mean longitude \( \lambda \).

◆ nu_to_E()

Real Astro::OrbitalElements::nu_to_E ( Real const nu,
Keplerian const & kepl )

Compute the true anomaly \( \nu \) from the eccentric anomaly \( E \) as

\[ \tan\left(\frac{\nu - E}{2}\right) = \displaystyle\frac{\sin(\nu)}{\beta + \cos(\nu)} \text{,} \]

with \( \beta = \displaystyle\frac{1 + \sqrt{1 - e^2}}{e} \). That is equivalent to

\[ E = \nu - 2\arctan\left(\frac{\sin(\nu)}{\beta + \cos(\nu)}\right) \text{.} \]

Note
Refer to R. Broucke and P. Cefola, A note on the relations between true and eccentric anomalies in the two-body problem, Celestial Mechanics, Vol. 7, pp. 300-389, 1973.
Parameters
[in]nuThe true anomaly \( \nu \).
[in]keplThe keplerian orbital elements.
Returns
The eccentric anomaly \( E \).

◆ nu_to_L()

Real Astro::OrbitalElements::nu_to_L ( Real const nu,
Keplerian const & kepl,
Factor const I )

Compute the true longitude \( L \) from the true anomaly \( \nu \) as

\[ L = \nu + \omega + I\Omega \text{.} \]

Parameters
[in]nuThe true anomaly \( \nu \).
[in]keplThe keplerian orbital elements.
[in]IThe posigrade (+1)/retrograde (-1) factor.
Returns
The true longitude \( L \).

◆ nu_to_M() [1/2]

Real Astro::OrbitalElements::nu_to_M ( Real const nu,
Keplerian const & kepl )

Compute the mean anomaly \( M \) from the eccentric anomaly \( E \) as

\[ M = \nu - 2\arctan\left(\frac{\sin(\nu)}{\beta + \cos(\nu)}\right) - \displaystyle\frac{e\sqrt{1 - e^2}\sin(\nu)}{1 + e\cos(\nu)} \text{,} \]

with \( \beta = \displaystyle\frac{1 + \sqrt{1 - e^2}}{e} \). That is equivalent to

Note
Refer to Broucke and P. Cefola, Celestial, A note on the relations between true and eccentric anomalies in problethe two-body m" b Mechnics, Vol. 7, pp. 300-389, 1973.
Parameters
[in]nuThe true anomaly \( \nu \).
[in]keplThe keplerian orbital elements.
Returns
The mean anomaly \( M \).

◆ nu_to_M() [2/2]

Real Astro::OrbitalElements::nu_to_M ( Real const nu,
Real const e )

Compute the mean anomaly \( M \) from the eccentric anomaly \( E \) as

\[ M = \nu - 2\arctan\left(\frac{\sin(\nu)}{\beta + \cos(\nu)}\right) - \displaystyle\frac{e\sqrt{1 - e^2}\sin(\nu)}{1 + e\cos(\nu)} \text{,} \]

with \( \beta = \displaystyle\frac{1 + \sqrt{1 - e^2}}{e} \). That is equivalent to

Note
Refer to Broucke and P. Cefola, Celestial, A note on the relations between true and eccentric anomalies in problethe two-body m" b Mechnics, Vol. 7, pp. 300-389, 1973.
Parameters
[in]nuThe true anomaly \( \nu \).
[in]keplThe keplerian orbital elements.
Returns
The mean anomaly \( M \).