Class OrbitalMotionLibrary
- Namespace
- NominalSystems.Universe
- Assembly
- NominalSystems.Universe.dll
Helper library for Orbital motion functions. These include Classical (Keplerian) elements, Vector Elements, Two Line Elements, Hill Frame and general orbital motion. All methods are public and can be used by any class at any point in time.
public static class OrbitalMotionLibrary
- Inheritance
-
OrbitalMotionLibrary
Methods
ClassicalElem2VectorElem(double, ClassicElements)
Converts a classic elements to a vector elements based on the MU of the body
public static VectorElements ClassicalElem2VectorElem(double mu, ClassicElements classicElements)
Parameters
mu
double[-] Gravitational MU parameter
classicElements
ClassicElements[-] A classical elements struct
Returns
- VectorElements
[-] A vector element struct
Eccentric2MeanAnom(double, double)
Maps the eccentric anomaly angle into the corresponding mean elliptic anomaly angle. Both 2D and 1D elliptic orbit are allowed.
public static double Eccentric2MeanAnom(double eccentricAnom, double eccentricity)
Parameters
Returns
- double
[rad] Mean elliptic anomaly
Eccentric2TrueAnom(double, double)
Converts the Eccentric Anomaly to the True Anomaly
public static double Eccentric2TrueAnom(double eccentricAnom, double eccentricity)
Parameters
eccentricAnom
double[rad] The Eccentric Anomaly
eccentricity
double[-] The eccentricity of the orbit (0 <= e > 1)
Returns
- double
[rad] The True Anomaly
Hill2VectorElem(Vector3, Vector3, Vector3, Vector3)
Maps Hill frame deputy states to inertial inertial position and velocity vectors
public static VectorElements Hill2VectorElem(Vector3 rc_N, Vector3 vc_N, Vector3 rho_H, Vector3 rhoPrime_H)
Parameters
rc_N
Vector3[m] Chief inertial position vector
vc_N
Vector3[m/s] Chief inertial velocity vector
rho_H
Vector3[m] Deputy Hill position vector
rhoPrime_H
Vector3[m/s] Deputy Hill velocity vector
Returns
- VectorElements
[-] The vector elements of the other body
InertialFrameToHillFrame(Vector3, Vector3)
Maps inertial position and velocity vectors in the Hill frame DCM HN
public static Matrix3 InertialFrameToHillFrame(Vector3 rc_N, Vector3 vc_N)
Parameters
Returns
- Matrix3
[-] Hill frame DCM relative to inertial frame
Mean2EccentricAnom(double, double)
Converts the Mean Anomaly to the Eccentric Anomaly
public static double Mean2EccentricAnom(double meanAnom, double eccentricity)
Parameters
meanAnom
double[rad] The Mean Anomaly
eccentricity
double[-] The eccentricity of the orbit (0 <= e > 1)
Returns
- double
[rad] The Eccentric Anomaly
Mean2OscElem(double, double, ClassicElements, bool)
First-order J2 Mapping Between Mean and Osculating Orbital Elements Analytical Mechanics of Space Systems, Hanspeter Schaub, John L. Junkins, 4th edition. [m] or [km] should be the same both for req and elements.
public static ClassicElements Mean2OscElem(double Req, double J2, ClassicElements OE, bool MeanToOsc)
Parameters
Req
double[-] Equatorial radius or the orbital body
J2
double[-] J2 parameter for the orbital body of interest
OE
ClassicElements[-] Classical orbit element set
MeanToOsc
bool[-] Sgn=True:mean to osc, Sgn=False:osc to mean
Returns
- ClassicElements
[-] A classical element struct
Period(double, ClassicElements)
Calculates the orbital period of a body based on its classical elements relative to an orbited body.
public static double Period(double mu, ClassicElements elements)
Parameters
mu
doubleThe body being orbited's Mu parameter
elements
ClassicElementsThe classical orbit elements
Returns
- double
[s] The orbit time in seconds
Period(double, double)
Calculate the period of the orbit
public static double Period(double mu, double semiMajorAxis)
Parameters
mu
doubleThe primary body gravitational parameter
semiMajorAxis
double[m] The orbit semi-major axis
Returns
- double
[s] The orbit time in seconds
Exceptions
- Exception
An error in the SMA or Mu will throw an error
ProgressByTime(VectorElements, double, double)
Progresses some Vector Elements that are about some orbital body with a Mu by some time. This will predict where the orbit will be after a specific amount of seconds.
public static VectorElements ProgressByTime(VectorElements initial, double mu, double delta)
Parameters
initial
VectorElements[m] The initial vector elements to start with
mu
double[m3 s−2] The orbiting planet's Mu
delta
double[s] The time to progress by
Returns
- VectorElements
[m] The final vector elements that have been progressed by a certain amount of time
TLE2ClassicElements(TwoLineElements)
Converts The TLE to Classic Elements
public static ClassicElements TLE2ClassicElements(TwoLineElements tle)
Parameters
tle
TwoLineElementsThe Two Line Elements data
Returns
- ClassicElements
The Classic Elements data
True2EccentricAnom(double, double)
Maps true anomaly angles into eccentric anomaly angles. This function requires the orbit to be either circular or non - rectilinear elliptic orbit.
public static double True2EccentricAnom(double trueAnom, double eccentricity)
Parameters
Returns
- double
[rad] Eccentric anomaly
True2MeanAnom(double, double)
Calculate the mean anomaly from the true anomaly
public static double True2MeanAnom(double trueAnom, double eccentricity)
Parameters
trueAnom
double[rad] The true anomaly of the orbit
eccentricity
double[-] The eccentricity of the orbit (0 <= e > 1)
Returns
- double
[rad] Mean elliptic anomaly
VectorElem2ClassicalElem(double, VectorElements)
Converts a vector elements to a classic elements based on the MU of the body
public static ClassicElements VectorElem2ClassicalElem(double mu, VectorElements rv)
Parameters
mu
double[-] Gravitational MU parameter
rv
VectorElements[-] A vector elements struct
Returns
- ClassicElements
[-] A classic element struct