org.vizzini.math.orbit
Class OrbitMechanic

java.lang.Object
  extended by org.vizzini.math.orbit.OrbitMechanic

public class OrbitMechanic
extends Object

Provides a helper class for orbit mechanics calculations.

Classical Orbital Elements

Symbol Description Units
mu gravitational parameter km^3 sec^-2
a semi-major axis km
ecc eccentricity N/A
i inclination radians
omega longitude of the ascending node radians
w argument of periapsis radians
nu true anomaly radians

Additional parameters

Symbol Description Units
P period sec
n mean motion radians/sec
M mean anomaly radians
E eccentric anomaly radians
t time sec
tp time of periapsis passage sec

Since:
v0.3
Version:
v0.3
Author:
Jeffrey M. Thompson

Method Summary
protected  double acos(double numerator, double denominator)
          Compute the arc cosine using the given numerator and denominator.
protected  double checkAngleBounds(double angle)
          Make the given angle in [0.0, 2*PI].
 Vector computeE(double mu, Vector r, Vector v)
          Compute the eccentricity vector E.
 double computeEcc(double mu, Vector r, Vector v)
          Compute the eccentricity.
 double computeEccentricAnomalyFromEccM(double ecc, double meanAnomaly)
          Compute the eccentric anomaly from the given parameters.
 double computeEccentricAnomalyFromEccM(double ecc, double meanAnomaly, double delta)
          Compute the eccentric anomaly from the given parameters.
 double computeEccentricAnomalyFromEccNu(double ecc, double trueAnomaly)
          Compute the eccentric anomaly from the given parameters.
 Vector computeH(Vector r, Vector v)
          Compute the angular momentum vector H.
 double computeMeanAnomalyFromEccE(double ecc, double eccentricAnomaly)
          Compute mean anomaly from the given parameters.
 double computeMeanAnomalyFromT(double mu, double a, double m0, double t, double t0)
          Compute mean anomaly from the given parameters.
 double computeMeanMotion(double mu, double a)
          Compute mean motion from the given parameters.
 Vector computeN(Vector h)
          Compute the node vector N.
 double computeOmega(Vector n)
          Compute the longitude of the ascending node.
 double computePeriod(double mu, double a)
          Compute period of orbit from the given parameter.
 Vector computeR(double mu, double a, double ecc, double i, double omega, double w, double nu)
          Compute the position vector for the given orbit elements.
 Vector[] computeRAndV(double mu, double a, double ecc, double i, double omega, double w, double nu)
          Compute the position and velocity vectors for the given orbit elements.
 double computeSemiLatusRectum(double a, double ecc)
          Compute the semi-latus rectum.
 double computeSemiMajorAxis(double p, double ecc)
          Compute the semi-major axis.
 double computeT(double mu, double a, double meanAnomaly, double meanAnomaly0, double t0)
          Compute time from the given paramters.
 double computeTimeOfPeriapsisPassage(double mu, double a, double ecc, double meanAnomaly0, double t0)
          Return the time of periapsis passage.
 double computeTrueAnomaly(double ecc, double eccentricAnomaly)
          Compute the true anomaly from the given parameters.
 double computeTrueAnomaly(Vector e, Vector n, Vector r, Vector v)
          Compute the true anomaly from the given parameters.
 Vector computeV(double mu, double a, double ecc, double i, double omega, double w, double nu)
          Compute the velocity vector for the given orbit elements.
 double computeW(Vector e, Vector n)
          Compute the argument of periapsis.
static OrbitMechanic getInstance()
          Return the singleton instance.
 boolean isCircularOrbit(double ecc)
          Return true if the given eccentricity indicates a circular orbit.
 boolean isEllipticOrbit(double ecc)
          Return true if the given eccentricity indicates an elliptic orbit.
 boolean isHyperbolicOrbit(double ecc)
          Return true if the given eccentricity indicates a hyperbolic orbit.
 boolean isParabolicOrbit(double ecc)
          Return true if the given eccentricity indicates a parabolic orbit.
protected  double quadrantCheck(double angle, double factor)
          Perform a quadrant check on the given angle.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static OrbitMechanic getInstance()
Return the singleton instance.

Since:
v0.3

computeE

public Vector computeE(double mu,
                       Vector r,
                       Vector v)
Compute the eccentricity vector E.

Parameters:
mu - Gravitational parameter of central body. (km^3 sec^-2)
r - Position vector. (km)
v - Velocity vector. (km/sec)
Since:
v0.3

computeEcc

public double computeEcc(double mu,
                         Vector r,
                         Vector v)
Compute the eccentricity.

Parameters:
mu - Gravitational parameter of central body. (km^3 sec^-2)
r - Position vector. (km)
v - Velocity vector. (km/sec)
Since:
v0.3

computeEccentricAnomalyFromEccM

public double computeEccentricAnomalyFromEccM(double ecc,
                                              double meanAnomaly)
Compute the eccentric anomaly from the given parameters.

Parameters:
ecc - Eccentricity.
meanAnomaly - Mean anomaly. (radians)
Since:
v0.3

computeEccentricAnomalyFromEccM

public double computeEccentricAnomalyFromEccM(double ecc,
                                              double meanAnomaly,
                                              double delta)
Compute the eccentric anomaly from the given parameters.

Parameters:
ecc - Eccentricity.
meanAnomaly - Mean anomaly. (radians)
delta - Allowable error in mean anomaly.
Since:
v0.3

computeEccentricAnomalyFromEccNu

public double computeEccentricAnomalyFromEccNu(double ecc,
                                               double trueAnomaly)
Compute the eccentric anomaly from the given parameters.

Parameters:
ecc - Eccentricity.
trueAnomaly - True anomaly. (radians)
Since:
v0.3

computeH

public Vector computeH(Vector r,
                       Vector v)
Compute the angular momentum vector H.

Parameters:
r - Position vector. (km)
v - Velocity vector. (km/sec)
Since:
v0.3

computeMeanAnomalyFromEccE

public double computeMeanAnomalyFromEccE(double ecc,
                                         double eccentricAnomaly)
Compute mean anomaly from the given parameters. This method uses Kepler's Equation.

Parameters:
ecc - Eccentricity.
Since:
v0.3

computeMeanAnomalyFromT

public double computeMeanAnomalyFromT(double mu,
                                      double a,
                                      double m0,
                                      double t,
                                      double t0)
Compute mean anomaly from the given parameters.

Parameters:
mu - Gravitational parameter of central body. (km^3 sec^-2)
Since:
v0.3

computeMeanMotion

public double computeMeanMotion(double mu,
                                double a)
Compute mean motion from the given parameters.

Parameters:
mu - Gravitational parameter of central body. (km^3 sec^-2)
a -
Since:
v0.3

computeN

public Vector computeN(Vector h)
Compute the node vector N.

Parameters:
h - Angular momentum vector.
Since:
v0.3

computeOmega

public double computeOmega(Vector n)
Compute the longitude of the ascending node.

Since:
v0.3

computePeriod

public double computePeriod(double mu,
                            double a)
Compute period of orbit from the given parameter.

Parameters:
mu - Gravitational parameter of central body. (km^3 sec^-2)
a - Semi-major axis. (km)
Returns:
orbital period. (sec)
Since:
v0.3

computeR

public Vector computeR(double mu,
                       double a,
                       double ecc,
                       double i,
                       double omega,
                       double w,
                       double nu)
Compute the position vector for the given orbit elements.

Parameters:
mu - Gravitational parameter of central body. (km^3 sec^-2)
a - Semi-major axis. (km)
ecc - Eccentricity.
i - Inclination. (radians)
omega - Longitude of the ascending node. (radians)
w - Argument of periapsis. (radians)
nu - True anomaly at epoch. (radians)
Since:
v0.3

computeRAndV

public Vector[] computeRAndV(double mu,
                             double a,
                             double ecc,
                             double i,
                             double omega,
                             double w,
                             double nu)
Compute the position and velocity vectors for the given orbit elements.

Parameters:
mu - Gravitational parameter of central body. (km^3 sec^-2)
a - Semi-major axis. (km)
ecc - Eccentricity.
i - Inclination. (radians)
omega - Longitude of the ascending node. (radians)
w - Argument of periapsis. (radians)
nu - True anomaly at epoch. (radians)
Since:
v0.3

computeSemiLatusRectum

public double computeSemiLatusRectum(double a,
                                     double ecc)
Compute the semi-latus rectum.

Parameters:
ecc - Eccentricity.
Since:
v0.3

computeSemiMajorAxis

public double computeSemiMajorAxis(double p,
                                   double ecc)
Compute the semi-major axis.

Parameters:
p - Semi-latus rectum. (km)
ecc - Eccentricity.
Since:
v0.3

computeT

public double computeT(double mu,
                       double a,
                       double meanAnomaly,
                       double meanAnomaly0,
                       double t0)
Compute time from the given paramters.

Parameters:
mu - Gravitational parameter of central body. (km^3 sec^-2)
a - Semi-major axis. (km)
meanAnomaly - Mean anomaly at desired time. (radians)
meanAnomaly0 - Mean anomaly at t0. (radians)
t0 - Time of epoch. (sec)
Since:
v0.3

computeTimeOfPeriapsisPassage

public double computeTimeOfPeriapsisPassage(double mu,
                                            double a,
                                            double ecc,
                                            double meanAnomaly0,
                                            double t0)
Return the time of periapsis passage.

Parameters:
mu - Gravitational parameter of central body. (km^3 sec^-2)
a - Semi-major axis. (km)
meanAnomaly0 - Mean anomaly at t0. (radians)
t0 - Time of epoch. (sec)
Since:
v0.3

computeTrueAnomaly

public double computeTrueAnomaly(double ecc,
                                 double eccentricAnomaly)
Compute the true anomaly from the given parameters.

Parameters:
ecc - Eccentricity.
eccentricAnomaly - Eccentric anomaly at time of interest. (radians)
Since:
v0.3

computeTrueAnomaly

public double computeTrueAnomaly(Vector e,
                                 Vector n,
                                 Vector r,
                                 Vector v)
Compute the true anomaly from the given parameters.

Parameters:
e - Eccentricity vector.
n - Normal vector.
r - Position vector. (km)
v - Velocity vector. (km/sec)
Since:
v0.3

computeV

public Vector computeV(double mu,
                       double a,
                       double ecc,
                       double i,
                       double omega,
                       double w,
                       double nu)
Compute the velocity vector for the given orbit elements.

Parameters:
mu - Gravitational parameter of central body. (km^3 sec^-2)
a - Semi-major axis. (km)
ecc - Eccentricity.
i - Inclination. (radians)
omega - Longitude of the ascending node. (radians)
w - Argument of periapsis. (radians)
nu - True anomaly at epoch. (radians)
Since:
v0.3

computeW

public double computeW(Vector e,
                       Vector n)
Compute the argument of periapsis.

Parameters:
e - Eccentricity vector.
n - Normal vector.
Since:
v0.3

isCircularOrbit

public boolean isCircularOrbit(double ecc)
Return true if the given eccentricity indicates a circular orbit.

Parameters:
ecc - Eccentricity.
Since:
v0.3

isEllipticOrbit

public boolean isEllipticOrbit(double ecc)
Return true if the given eccentricity indicates an elliptic orbit.

Parameters:
ecc - Eccentricity.
Since:
v0.3

isHyperbolicOrbit

public boolean isHyperbolicOrbit(double ecc)
Return true if the given eccentricity indicates a hyperbolic orbit.

Parameters:
ecc - Eccentricity.
Since:
v0.3

isParabolicOrbit

public boolean isParabolicOrbit(double ecc)
Return true if the given eccentricity indicates a parabolic orbit.

Parameters:
ecc - Eccentricity.
Since:
v0.3

acos

protected double acos(double numerator,
                      double denominator)
Compute the arc cosine using the given numerator and denominator.

Since:
v0.3

checkAngleBounds

protected double checkAngleBounds(double angle)
Make the given angle in [0.0, 2*PI].

Parameters:
angle - Angle. (radians)
Since:
v0.3

quadrantCheck

protected double quadrantCheck(double angle,
                               double factor)
Perform a quadrant check on the given angle.

Parameters:
angle - Angle.
factor - Factor which determines if the angle should be less than PI radians.
Since:
v0.3


Copyright © 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02