public final class EquinoctialElements extends Object implements ICloneWithContext
A set of equinoctial orbital elements. This is a nonsingular orbital element set that is
often used in operational systems since it is well behaved for small eccentricities and
inclinations. The Direction
(get
) element of the structure indicates whether
the orbit is posigrade or retrograde.
All units are SI unless indicated otherwise. For more information see the Units topic.
Constructor and Description |
---|
EquinoctialElements(Cartesian position,
Cartesian velocity,
double gravitationalParameter)
Initialize a set of equinoctial elements from cartesian position and velocity.
|
EquinoctialElements(DelaunayElements elements)
Initialize a set of equinoctial elements from a set of
DelaunayElements . |
EquinoctialElements(double semimajorAxis,
double eccentricitySineLongitudeOfPeriapsis,
double eccentricityCosineLongitudeOfPeriapsis,
double inclinationAndRightAscensionSineParameter,
double inclinationAndRightAscensionCosineParameter,
double meanLongitude,
boolean isPosigrade,
double gravitationalParameter)
Initialize a set of equinoctial elements.
|
EquinoctialElements(KeplerianElements elements)
Initialize a set of equinoctial elements from a set of classical
KeplerianElements . |
EquinoctialElements(ModifiedKeplerianElements elements)
Initialize a set of equinoctial elements from a set of
ModifiedKeplerianElements . |
EquinoctialElements(Motion1<Cartesian> motion,
double gravitationalParameter)
Initializes a new instance from the specified cartesian motion and gravitational constant.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone(CopyContext context)
Clones this object using the specified context.
|
double |
getDirection()
Gets the parameter indicating whether this orbit is posigrade (+1.0) or retrograde (-1.0).
|
double |
getEccentricityCosineLongitudeOfPeriapsis()
Gets the Eccentricity * Cos(Argument Of Periapsis +
Direction (get )*Right Ascension Of Ascending Node) |
double |
getEccentricitySineLongitudeOfPeriapsis()
Gets the Eccentricity * Sin(Argument Of Periapsis +
Direction (get )*Right Ascension Of Ascending Node) |
double |
getGravitationalParameter()
Gets the gravitational parameter associated with this element set (distance cubed per time squared).
|
double |
getInclinationAndRightAscensionCosineParameter()
Gets the Sin(Inclination)*Cos(Right Ascension Of Ascending Node) / (1 + Cos(Inclination) )
|
double |
getInclinationAndRightAscensionSineParameter()
Gets the Sin(Inclination)*Sin(Right Ascension Of Ascending Node) / (1 + Cos(Inclination) )
|
double |
getMeanLongitude()
Gets the Mean Anomaly + Argument Of Periapsis +
Direction (get )*Right Ascension Of Ascending Node (radians) |
double |
getSemimajorAxis()
Gets the Semimajor axis (distance).
|
static double |
meanLongitudeToEccentricLongitude(double meanLongitude,
double eccentricitySineLongitudeOfPeriapsis,
double eccentricityCosineLongitudeOfPeriapsis)
Converts the longitude of mean anomaly to longitude of eccentric anomaly.
|
Motion1<Cartesian> |
toCartesian()
Converts this set of equinoctial elements to a cartesian position and velocity.
|
public EquinoctialElements(double semimajorAxis, double eccentricitySineLongitudeOfPeriapsis, double eccentricityCosineLongitudeOfPeriapsis, double inclinationAndRightAscensionSineParameter, double inclinationAndRightAscensionCosineParameter, double meanLongitude, boolean isPosigrade, double gravitationalParameter)
semimajorAxis
- The semimajor axis (distance).eccentricitySineLongitudeOfPeriapsis
- Eccentricity * Sin(Argument Of Periapsis + Direction
(get
) * Right Ascension Of Ascending Node)eccentricityCosineLongitudeOfPeriapsis
- Eccentricity * Cos(Argument Of Periapsis + Direction
(get
) * Right Ascension Of Ascending Node)inclinationAndRightAscensionSineParameter
- Sin(Inclination) * Sin(Right Ascension Of Ascending Node) / (1 + Cos(Inclination) )inclinationAndRightAscensionCosineParameter
- Sin(Inclination) * Cos(Right Ascension Of Ascending Node) / (1 + Cos(Inclination) )meanLongitude
- Mean Anomaly + Argument Of Periapsis + Direction
(get
) * Right Ascension Of Ascending Node (radians)isPosigrade
- Boolean indicating whether this orbit is posigrade (true) or retrograde (false).gravitationalParameter
- Gravitational parameter associated with these elements (distance cubed per time squared).IllegalStateException
- Thrown if the orbit represented by these elements does not constitute a
closed orbit (eccentricity must be between zero and unity).public EquinoctialElements(@Nonnull Cartesian position, @Nonnull Cartesian velocity, double gravitationalParameter)
position
- Cartesian position (distance).velocity
- Cartesian velocity (distance per time).gravitationalParameter
- Gravitational parameter (distance cubed per time squared).IllegalStateException
- Thrown when the position
and velocity
represent
an open orbit (with an eccentricity greater than or equal to one).public EquinoctialElements(@Nonnull Motion1<Cartesian> motion, double gravitationalParameter)
motion
- The cartesian position and velocity (distance and distance per time).gravitationalParameter
- The gravitational parameter for the central body
(distance cubed per time squared).public EquinoctialElements(@Nonnull ModifiedKeplerianElements elements)
ModifiedKeplerianElements
.elements
- A set of modified Keplerian elements.ArgumentNullException
- Thrown if elements
is null
.IllegalStateException
- Thrown when the provided equinoctial elements represent an open orbit.public EquinoctialElements(@Nonnull KeplerianElements elements)
KeplerianElements
.elements
- A set of classical Keplerian elements.ArgumentException
- EquinoctialElements
cannot represent open orbits.public EquinoctialElements(@Nonnull DelaunayElements elements)
DelaunayElements
.elements
- A set of Delaunay elements.public final Object clone(CopyContext context)
This method should be implemented to call a copy constructor on the class of the
object being cloned. The copy constructor should take the CopyContext
as a parameter
in addition to the existing instance to copy. The copy constructor should first call
CopyContext.addObjectMapping(T, T)
to identify the newly constructed instance
as a copy of the existing instance. It should then copy all fields, using
CopyContext.updateReference(T)
to copy any reference fields.
A typical implementation of ICloneWithContext
:
public static class MyClass implements ICloneWithContext {
public MyClass(MyClass existingInstance, CopyContext context) {
context.addObjectMapping(existingInstance, this);
someReference = context.updateReference(existingInstance.someReference);
}
@Override
public final Object clone(CopyContext context) {
return new MyClass(this, context);
}
private Object someReference;
}
In general, all fields that are reference types should be copied with a call to
CopyContext.updateReference(T)
. There are a couple of exceptions:
If one of these exceptions applies, the CopyContext
should be given an opportunity
to update the reference before the reference is copied explicitly. Use
CopyContext.updateReference(T)
to update the reference. If CopyContext.updateReference(T)
returns
the original object, indicating that the context does not have a replacement registered,
then copy the object manually by invoking a Clone method, a copy constructor, or by manually
constructing a new instance and copying the values.
alwaysCopy = context.updateReference(existingInstance.alwaysCopy);
if (existingInstance.alwaysCopy != null && alwaysCopy == existingInstance.alwaysCopy) {
alwaysCopy = (AlwaysCopy) existingInstance.alwaysCopy.clone(context);
}
If you are implementing an evaluator (a class that implements IEvaluator
), the
IEvaluator.updateEvaluatorReferences(agi.foundation.infrastructure.CopyContext)
method shares some responsibilities with the
copy context constructor. Code duplication can be avoided by doing the following:
CopyContext.updateReference(T)
. You should still call CopyContext.updateReference(T)
on any references to
non-evaluators.
IEvaluator.updateEvaluatorReferences(agi.foundation.infrastructure.CopyContext)
as the last line in the constructor and pass it the
same CopyContext
passed to the constructor.
IEvaluator.updateEvaluatorReferences(agi.foundation.infrastructure.CopyContext)
as normal. See the reference documentation for
IEvaluator.updateEvaluatorReferences(agi.foundation.infrastructure.CopyContext)
for more information on implementing that method.
public MyClass(MyClass existingInstance, CopyContext context) {
super(existingInstance, context);
someReference = context.updateReference(existingInstance.someReference);
evaluatorReference = existingInstance.evaluatorReference;
updateEvaluatorReferences(context);
}
@Override
public void updateEvaluatorReferences(CopyContext context) {
evaluatorReference = context.updateReference(evaluatorReference);
}
@Override
public Object clone(CopyContext context) {
return new MyClass(this, context);
}
private Object someReference;
private IEvaluator evaluatorReference;
clone
in interface ICloneWithContext
context
- The context to use to perform the copy.@Nonnull public final Motion1<Cartesian> toCartesian()
public static double meanLongitudeToEccentricLongitude(double meanLongitude, double eccentricitySineLongitudeOfPeriapsis, double eccentricityCosineLongitudeOfPeriapsis)
meanLongitude
- The longitude of the mean anomaly (radians).eccentricitySineLongitudeOfPeriapsis
- The sine term of the equinoctial elements.eccentricityCosineLongitudeOfPeriapsis
- The cosine term of the equinoctial elements.IllegalStateException
- This method throws an exception if the orbit is not closed.IllegalStateException
- Thrown when the provided arguments do not allow this function to converge.EquinoctialElements.getEccentricitySineLongitudeOfPeriapsis()
,
EquinoctialElements.getEccentricityCosineLongitudeOfPeriapsis()
public final double getSemimajorAxis()
public final double getEccentricitySineLongitudeOfPeriapsis()
Direction
(get
)*Right Ascension Of Ascending Node)public final double getEccentricityCosineLongitudeOfPeriapsis()
Direction
(get
)*Right Ascension Of Ascending Node)public final double getInclinationAndRightAscensionSineParameter()
public final double getInclinationAndRightAscensionCosineParameter()
public final double getMeanLongitude()
Direction
(get
)*Right Ascension Of Ascending Node (radians)public final double getDirection()
public final double getGravitationalParameter()