Package gaiasky.util.elements
Class OsculatingElements
java.lang.Object
gaiasky.util.elements.OsculatingElements
Represent and manipulate osculating elements of the elliptic two-body
problem. The class supports the representation in elliptical elements, or in
position-velocity. Methods perform the transformation in both directions,
solve the Kepler equation, propagate the motion to another date.
By default the central body is the Sun and the units are
By default the central body is the Sun and the units are
AU
,
AU day-1
. The default GM
(gravitational
constant times mass) can be overridden by using the constructors taking
mu
as an argument.-
Field Summary
-
Constructor Summary
ConstructorDescriptionOsculatingElements
(double[] elliptic) Assuming the Sun is the central body.OsculatingElements
(double[] elliptic, double mu) The Constructor.OsculatingElements
(double semiaxis, double eccent, double gamma, double bomega, double somega, double anom) Assuming the Sun is the central body.OsculatingElements
(double semiaxis, double eccent, double gamma, double bomega, double somega, double anom, double mu) The Constructor.OsculatingElements
(double mu, Vector3d pos, Vector3d vel) Create elliptic elements from position-velocity.OsculatingElements
(Vector3d pos, Vector3d vel) Create elliptic elements from position-velocity, assuming the Sun as the central body. -
Method Summary
Modifier and TypeMethodDescriptionVector3d[]
advanceTwoBody
(double xanom) Advance a position-velocity vector at a new mean anomaly.double
Gets the eccentricity.double[]
Gets the elements.double
Gets the inclination.double
Gets the mean anomaly.double
getMu()
Gets the mu.double
getNode()
Gets the node.double
Gets the pericenter.Gets the position at pericenter.double
Gets the semi major axis.Gets the velocity at pericenter.Vector3d[]
Transform elliptic element into position and velocity vector.static double[]
toElliptic
(double mu, Vector3d pos, Vector3d vel) Compute elliptic elements corresponding to the given Cartesian representation.
-
Field Details
-
GAUSS_CONSTANT
public static final double GAUSS_CONSTANT- See Also:
-
-
Constructor Details
-
OsculatingElements
public OsculatingElements(double semiaxis, double eccent, double gamma, double bomega, double somega, double anom, double mu) The Constructor.- Parameters:
semiaxis
- Semi-major axis.eccent
- Eccentricity.gamma
- Inclination (units:rad
).bomega
- Longitude of node (units:rad
).somega
- Argument of periastron (units:rad
).anom
- Mean anomaly (units:rad
).mu
-GM
for the central body.
-
OsculatingElements
public OsculatingElements(double[] elliptic, double mu) The Constructor.- Parameters:
elliptic
- Six elliptic elements, in the following order: a, e, i, omega, pi, M.mu
-GM
for the central body.- Throws:
IllegalArgumentException
- if the length of is different from 6.
-
OsculatingElements
public OsculatingElements(double[] elliptic) Assuming the Sun is the central body.- Parameters:
elliptic
- Six elliptic elements, in the following order: a, e, i, omega, pi, M.
-
OsculatingElements
public OsculatingElements(double semiaxis, double eccent, double gamma, double bomega, double somega, double anom) Assuming the Sun is the central body.- Parameters:
semiaxis
- Semi-major axis.eccent
- Eccentricity.gamma
- Inclination (units:rad
).bomega
- Longitude of node (units:rad
).somega
- Argument of periastron (units:rad
).anom
- Mean anomaly (units:rad
).
-
OsculatingElements
Create elliptic elements from position-velocity, assuming the Sun as the central body.- Parameters:
pos
- Position.vel
- Velocity.
-
OsculatingElements
Create elliptic elements from position-velocity.- Parameters:
mu
- GM.pos
- Position.vel
- Velocity.
-
-
Method Details
-
toElliptic
Compute elliptic elements corresponding to the given Cartesian representation.- Parameters:
mu
- GM.pos
- Position.vel
- Velocity.- Returns:
- the six elliptic elements in an array (order: a, e, i, node, pericenter, mean anomaly).
-
toCartesian
Transform elliptic element into position and velocity vector.Units are set by the choice of
GM
. By defaultGM = k2
; hence, the units areAU
, andAU day-1
(k = GAUSS_CONSTANT
). Another choice can beGM = 4 pi2
; hence, the units will beAU
,AU year-1
. For an Earth satellite:GM = EARTH_GM
with unitsm
andm s-1
.- Returns:
- a Vector3d[2] with position in [0] and velocity in [1].
-
advanceTwoBody
Advance a position-velocity vector at a new mean anomaly. It is optimized for quick computation in the final reference frame. SeetoCartesian
for a discussion on the units.- Parameters:
xanom
- Mean anomaly at which the motion is propagated (units:rad
).- Returns:
- a Vector3d[2] with position in [0] and velocity in [1].
-
getElements
public double[] getElements()Gets the elements.- Returns:
- the six elliptic elements of this object in an array (order: a, e, i, node, pericenter, mean anomaly).
-
getSemiMajorAxis
public double getSemiMajorAxis()Gets the semi major axis.- Returns:
- the semi-major axis.
-
getEccentricity
public double getEccentricity()Gets the eccentricity.- Returns:
- the eccentricity.
-
getInclination
public double getInclination()Gets the inclination.- Returns:
- the inclination (units:
rad
).
-
getNode
public double getNode()Gets the node.- Returns:
- the longitude of node (units:
rad
).
-
getPericenter
public double getPericenter()Gets the pericenter.- Returns:
- the argument of pericenter (units:
rad
).
-
getMeanAnomaly
public double getMeanAnomaly()Gets the mean anomaly.- Returns:
- the mean anomaly (units:
rad
).
-
getMu
public double getMu()Gets the mu.- Returns:
- the
GM
.
-
getPositionAtPericenter
Gets the position at pericenter.- Returns:
- the position at pericenter.
-
getVelocityAtPericenter
Gets the velocity at pericenter.- Returns:
- the velocity at pericenter.
-