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 nu, Keplerian const &kepl)
 
Real nu_to_E (Real nu, Keplerian const &kepl)
 
Real nu_to_L (Real nu, Keplerian const &kepl, Factor I)
 
Real M_to_E (Real M, Keplerian const &kepl)
 
Real M_to_H (Real M, Keplerian const &kepl)
 
Real M_to_lambda (Real M, Keplerian const &kepl, Factor I)
 
Real E_to_nu (Real E, Keplerian const &kepl)
 
Real E_to_M (Real E, Keplerian const &kepl)
 
Real H_to_nu (Real H, Keplerian const &kepl)
 
Real H_to_M (Real H, Keplerian const &kepl)
 
Real L_to_nu (Real L, Keplerian const &kepl, Factor I)
 
Real L_to_lambda (Real L, Real nu, Real M)
 
Real lambda_to_M (Real lambda, Keplerian const &kepl, Factor I)
 
Real lambda_to_L (Real lambda, Real nu, Real M)
 
void cartesian_to_keplerian (Cartesian const &cart, Real mu, Keplerian &kepl)
 
void keplerian_to_cartesian (Keplerian const &kepl, Anomaly const &anom, Real mu, Cartesian &cart)
 
void equinoctial_to_cartesian (Equinoctial const &equi, Anomaly const &anom, Real mu, Cartesian &cart)
 
void keplerian_to_equinoctial (Keplerian const &kepl, Factor I, Equinoctial &equi)
 
void equinoctial_to_cartesian (Equinoctial const &equi, Anomaly const &anom, Factor I, Real mu, Cartesian &cart)
 
void equinoctial_to_keplerian (Equinoctial const &equi, Keplerian &kepl)
 

Function Documentation

◆ cartesian_to_keplerian()

void Astro::OrbitalElements::cartesian_to_keplerian ( Cartesian const & cart,
Real 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.

◆ E_to_M()

Real Astro::OrbitalElements::E_to_M ( Real 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_nu()

Real Astro::OrbitalElements::E_to_nu ( Real 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 \).

◆ equinoctial_to_cartesian() [1/2]

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

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

Parameters
[in]equiThe equinoctial orbital elements.
[in]anomThe orbital anomalies.
[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,
Anomaly const & anom,
Real mu,
Cartesian & cart )

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

Parameters
[in]equiThe equinoctial orbital elements.
[in]anomThe orbital anomalies.
[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 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 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,
Anomaly const & anom,
Real mu,
Cartesian & cart )

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

Parameters
[in]keplThe keplerian orbital elements.
[in]anomThe orbital anomalies.
[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 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 L,
Real nu,
Real 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 L,
Keplerian const & kepl,
Factor 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 lambda,
Real nu,
Real 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 lambda,
Keplerian const & kepl,
Factor 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()

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_H()

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

Compute the mean anomaly \( M \) from the mean anomaly \( M \) as \( 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 M,
Keplerian const & kepl,
Factor 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 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 nu,
Keplerian const & kepl,
Factor 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()

Real Astro::OrbitalElements::nu_to_M ( Real 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 \).