Class FieldPVCoordinates<T extends org.hipparchus.RealFieldElement<T>>
- java.lang.Object
-
- org.orekit.utils.FieldPVCoordinates<T>
-
- Type Parameters:
T
- the type of the field elements
- All Implemented Interfaces:
TimeShiftable<FieldPVCoordinates<T>>
- Direct Known Subclasses:
TimeStampedFieldPVCoordinates
public class FieldPVCoordinates<T extends org.hipparchus.RealFieldElement<T>> extends Object implements TimeShiftable<FieldPVCoordinates<T>>
Simple container for Position/Velocity pairs, usingRealFieldElement
.The state can be slightly shifted to close dates. This shift is based on a simple linear model. It is not intended as a replacement for proper orbit propagation (it is not even Keplerian!) but should be sufficient for either small time shifts or coarse accuracy.
This class is the angular counterpart to
FieldAngularCoordinates
.Instances of this class are guaranteed to be immutable.
- Since:
- 6.0
- Author:
- Luc Maisonobe
- See Also:
PVCoordinates
-
-
Constructor Summary
Constructors Constructor Description FieldPVCoordinates(double a, FieldPVCoordinates<T> pv)
Multiplicative constructor.FieldPVCoordinates(double a1, FieldPVCoordinates<T> pv1, double a2, FieldPVCoordinates<T> pv2)
Linear constructor.FieldPVCoordinates(double a1, FieldPVCoordinates<T> pv1, double a2, FieldPVCoordinates<T> pv2, double a3, FieldPVCoordinates<T> pv3)
Linear constructor.FieldPVCoordinates(double a1, FieldPVCoordinates<T> pv1, double a2, FieldPVCoordinates<T> pv2, double a3, FieldPVCoordinates<T> pv3, double a4, FieldPVCoordinates<T> pv4)
Linear constructor.FieldPVCoordinates(org.hipparchus.Field<T> field, PVCoordinates pv)
Builds a FieldPVCoordinates from a field and a regular PVCoordinates.FieldPVCoordinates(org.hipparchus.geometry.euclidean.threed.FieldVector3D<org.hipparchus.analysis.differentiation.FieldDerivativeStructure<T>> p)
Builds a FieldPVCoordinates triplet from aFieldVector3D
<FieldDerivativeStructure
>.FieldPVCoordinates(org.hipparchus.geometry.euclidean.threed.FieldVector3D<T> position, org.hipparchus.geometry.euclidean.threed.FieldVector3D<T> velocity)
Builds a FieldPVCoordinates triplet with zero acceleration.FieldPVCoordinates(org.hipparchus.geometry.euclidean.threed.FieldVector3D<T> position, org.hipparchus.geometry.euclidean.threed.FieldVector3D<T> velocity, org.hipparchus.geometry.euclidean.threed.FieldVector3D<T> acceleration)
Builds a FieldPVCoordinates triplet.FieldPVCoordinates(FieldPVCoordinates<T> start, FieldPVCoordinates<T> end)
Subtractive constructor.FieldPVCoordinates(T a, FieldPVCoordinates<T> pv)
Multiplicative constructor.FieldPVCoordinates(T a1, FieldPVCoordinates<T> pv1, T a2, FieldPVCoordinates<T> pv2)
Linear constructor.FieldPVCoordinates(T a1, FieldPVCoordinates<T> pv1, T a2, FieldPVCoordinates<T> pv2, T a3, FieldPVCoordinates<T> pv3)
Linear constructor.FieldPVCoordinates(T a1, FieldPVCoordinates<T> pv1, T a2, FieldPVCoordinates<T> pv2, T a3, FieldPVCoordinates<T> pv3, T a4, FieldPVCoordinates<T> pv4)
Linear constructor.FieldPVCoordinates(T a, PVCoordinates pv)
Multiplicative constructor.FieldPVCoordinates(T a1, PVCoordinates pv1, T a2, PVCoordinates pv2)
Linear constructor.FieldPVCoordinates(T a1, PVCoordinates pv1, T a2, PVCoordinates pv2, T a3, PVCoordinates pv3)
Linear constructor.FieldPVCoordinates(T a1, PVCoordinates pv1, T a2, PVCoordinates pv2, T a3, PVCoordinates pv3, T a4, PVCoordinates pv4)
Linear constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description FieldPVCoordinates<T>
crossProduct(FieldPVCoordinates<T> pv2)
Compute the cross-product of two instances.static <T extends org.hipparchus.RealFieldElement<T>>
org.hipparchus.geometry.euclidean.threed.FieldVector3D<T>estimateVelocity(org.hipparchus.geometry.euclidean.threed.FieldVector3D<T> start, org.hipparchus.geometry.euclidean.threed.FieldVector3D<T> end, double dt)
Estimate velocity between two positions.org.hipparchus.geometry.euclidean.threed.FieldVector3D<T>
getAcceleration()
Gets the acceleration.org.hipparchus.geometry.euclidean.threed.FieldVector3D<T>
getAngularVelocity()
Get the angular velocity (spin) of this point as seen from the origin.org.hipparchus.geometry.euclidean.threed.FieldVector3D<T>
getMomentum()
Gets the momentum.org.hipparchus.geometry.euclidean.threed.FieldVector3D<T>
getPosition()
Gets the position.org.hipparchus.geometry.euclidean.threed.FieldVector3D<T>
getVelocity()
Gets the velocity.static <T extends org.hipparchus.RealFieldElement<T>>
FieldPVCoordinates<T>getZero(org.hipparchus.Field<T> field)
Get fixed position/velocity at origin (both p, v and a are zero vectors).FieldPVCoordinates<T>
negate()
Get the opposite of the instance.FieldPVCoordinates<T>
normalize()
Normalize the position part of the instance.FieldPVCoordinates<T>
shiftedBy(double dt)
Get a time-shifted state.FieldPVCoordinates<T>
shiftedBy(T dt)
Get a time-shifted state.FieldPVCoordinates<org.hipparchus.analysis.differentiation.FieldDerivativeStructure<T>>
toDerivativeStructurePV(int order)
Transform the instance to aFieldPVCoordinates
<FieldDerivativeStructure
>.org.hipparchus.geometry.euclidean.threed.FieldVector3D<org.hipparchus.analysis.differentiation.FieldDerivativeStructure<T>>
toDerivativeStructureVector(int order)
Transform the instance to aFieldVector3D
<FieldDerivativeStructure
>.PVCoordinates
toPVCoordinates()
Convert to a constant position-velocity.String
toString()
Return a string representation of this position/velocity pair.
-
-
-
Constructor Detail
-
FieldPVCoordinates
public FieldPVCoordinates(org.hipparchus.geometry.euclidean.threed.FieldVector3D<T> position, org.hipparchus.geometry.euclidean.threed.FieldVector3D<T> velocity)
Builds a FieldPVCoordinates triplet with zero acceleration.- Parameters:
position
- the position vector (m)velocity
- the velocity vector (m/s)
-
FieldPVCoordinates
public FieldPVCoordinates(org.hipparchus.geometry.euclidean.threed.FieldVector3D<T> position, org.hipparchus.geometry.euclidean.threed.FieldVector3D<T> velocity, org.hipparchus.geometry.euclidean.threed.FieldVector3D<T> acceleration)
Builds a FieldPVCoordinates triplet.- Parameters:
position
- the position vector (m)velocity
- the velocity vector (m/s)acceleration
- the acceleration vector (m/s²)
-
FieldPVCoordinates
public FieldPVCoordinates(org.hipparchus.Field<T> field, PVCoordinates pv)
Builds a FieldPVCoordinates from a field and a regular PVCoordinates.- Parameters:
field
- field for the componentspv
- PVCoordinates triplet to convert
-
FieldPVCoordinates
public FieldPVCoordinates(double a, FieldPVCoordinates<T> pv)
Multiplicative constructor.Build a PVCoordinates from another one and a scale factor.
The PVCoordinates built will be a * pv
- Parameters:
a
- scale factorpv
- base (unscaled) PVCoordinates
-
FieldPVCoordinates
public FieldPVCoordinates(T a, FieldPVCoordinates<T> pv)
Multiplicative constructor.Build a PVCoordinates from another one and a scale factor.
The PVCoordinates built will be a * pv
- Parameters:
a
- scale factorpv
- base (unscaled) PVCoordinates
-
FieldPVCoordinates
public FieldPVCoordinates(T a, PVCoordinates pv)
Multiplicative constructor.Build a PVCoordinates from another one and a scale factor.
The PVCoordinates built will be a * pv
- Parameters:
a
- scale factorpv
- base (unscaled) PVCoordinates
-
FieldPVCoordinates
public FieldPVCoordinates(FieldPVCoordinates<T> start, FieldPVCoordinates<T> end)
Subtractive constructor.Build a relative PVCoordinates from a start and an end position.
The PVCoordinates built will be end - start.
- Parameters:
start
- Starting PVCoordinatesend
- ending PVCoordinates
-
FieldPVCoordinates
public FieldPVCoordinates(double a1, FieldPVCoordinates<T> pv1, double a2, FieldPVCoordinates<T> pv2)
Linear constructor.Build a PVCoordinates from two other ones and corresponding scale factors.
The PVCoordinates built will be a1 * u1 + a2 * u2
- Parameters:
a1
- first scale factorpv1
- first base (unscaled) PVCoordinatesa2
- second scale factorpv2
- second base (unscaled) PVCoordinates
-
FieldPVCoordinates
public FieldPVCoordinates(T a1, FieldPVCoordinates<T> pv1, T a2, FieldPVCoordinates<T> pv2)
Linear constructor.Build a PVCoordinates from two other ones and corresponding scale factors.
The PVCoordinates built will be a1 * u1 + a2 * u2
- Parameters:
a1
- first scale factorpv1
- first base (unscaled) PVCoordinatesa2
- second scale factorpv2
- second base (unscaled) PVCoordinates
-
FieldPVCoordinates
public FieldPVCoordinates(T a1, PVCoordinates pv1, T a2, PVCoordinates pv2)
Linear constructor.Build a PVCoordinates from two other ones and corresponding scale factors.
The PVCoordinates built will be a1 * u1 + a2 * u2
- Parameters:
a1
- first scale factorpv1
- first base (unscaled) PVCoordinatesa2
- second scale factorpv2
- second base (unscaled) PVCoordinates
-
FieldPVCoordinates
public FieldPVCoordinates(double a1, FieldPVCoordinates<T> pv1, double a2, FieldPVCoordinates<T> pv2, double a3, FieldPVCoordinates<T> pv3)
Linear constructor.Build a PVCoordinates from three other ones and corresponding scale factors.
The PVCoordinates built will be a1 * u1 + a2 * u2 + a3 * u3
- Parameters:
a1
- first scale factorpv1
- first base (unscaled) PVCoordinatesa2
- second scale factorpv2
- second base (unscaled) PVCoordinatesa3
- third scale factorpv3
- third base (unscaled) PVCoordinates
-
FieldPVCoordinates
public FieldPVCoordinates(T a1, FieldPVCoordinates<T> pv1, T a2, FieldPVCoordinates<T> pv2, T a3, FieldPVCoordinates<T> pv3)
Linear constructor.Build a PVCoordinates from three other ones and corresponding scale factors.
The PVCoordinates built will be a1 * u1 + a2 * u2 + a3 * u3
- Parameters:
a1
- first scale factorpv1
- first base (unscaled) PVCoordinatesa2
- second scale factorpv2
- second base (unscaled) PVCoordinatesa3
- third scale factorpv3
- third base (unscaled) PVCoordinates
-
FieldPVCoordinates
public FieldPVCoordinates(T a1, PVCoordinates pv1, T a2, PVCoordinates pv2, T a3, PVCoordinates pv3)
Linear constructor.Build a PVCoordinates from three other ones and corresponding scale factors.
The PVCoordinates built will be a1 * u1 + a2 * u2 + a3 * u3
- Parameters:
a1
- first scale factorpv1
- first base (unscaled) PVCoordinatesa2
- second scale factorpv2
- second base (unscaled) PVCoordinatesa3
- third scale factorpv3
- third base (unscaled) PVCoordinates
-
FieldPVCoordinates
public FieldPVCoordinates(double a1, FieldPVCoordinates<T> pv1, double a2, FieldPVCoordinates<T> pv2, double a3, FieldPVCoordinates<T> pv3, double a4, FieldPVCoordinates<T> pv4)
Linear constructor.Build a PVCoordinates from four other ones and corresponding scale factors.
The PVCoordinates built will be a1 * u1 + a2 * u2 + a3 * u3 + a4 * u4
- Parameters:
a1
- first scale factorpv1
- first base (unscaled) PVCoordinatesa2
- second scale factorpv2
- second base (unscaled) PVCoordinatesa3
- third scale factorpv3
- third base (unscaled) PVCoordinatesa4
- fourth scale factorpv4
- fourth base (unscaled) PVCoordinates
-
FieldPVCoordinates
public FieldPVCoordinates(T a1, FieldPVCoordinates<T> pv1, T a2, FieldPVCoordinates<T> pv2, T a3, FieldPVCoordinates<T> pv3, T a4, FieldPVCoordinates<T> pv4)
Linear constructor.Build a PVCoordinates from four other ones and corresponding scale factors.
The PVCoordinates built will be a1 * u1 + a2 * u2 + a3 * u3 + a4 * u4
- Parameters:
a1
- first scale factorpv1
- first base (unscaled) PVCoordinatesa2
- second scale factorpv2
- second base (unscaled) PVCoordinatesa3
- third scale factorpv3
- third base (unscaled) PVCoordinatesa4
- fourth scale factorpv4
- fourth base (unscaled) PVCoordinates
-
FieldPVCoordinates
public FieldPVCoordinates(T a1, PVCoordinates pv1, T a2, PVCoordinates pv2, T a3, PVCoordinates pv3, T a4, PVCoordinates pv4)
Linear constructor.Build a PVCoordinates from four other ones and corresponding scale factors.
The PVCoordinates built will be a1 * u1 + a2 * u2 + a3 * u3 + a4 * u4
- Parameters:
a1
- first scale factorpv1
- first base (unscaled) PVCoordinatesa2
- second scale factorpv2
- second base (unscaled) PVCoordinatesa3
- third scale factorpv3
- third base (unscaled) PVCoordinatesa4
- fourth scale factorpv4
- fourth base (unscaled) PVCoordinates
-
FieldPVCoordinates
public FieldPVCoordinates(org.hipparchus.geometry.euclidean.threed.FieldVector3D<org.hipparchus.analysis.differentiation.FieldDerivativeStructure<T>> p)
Builds a FieldPVCoordinates triplet from aFieldVector3D
<FieldDerivativeStructure
>.The vector components must have time as their only derivation parameter and have consistent derivation orders.
- Parameters:
p
- vector with time-derivatives embedded within the coordinates- Since:
- 9.2
-
-
Method Detail
-
getZero
public static <T extends org.hipparchus.RealFieldElement<T>> FieldPVCoordinates<T> getZero(org.hipparchus.Field<T> field)
Get fixed position/velocity at origin (both p, v and a are zero vectors).- Type Parameters:
T
- the type of the field elements- Parameters:
field
- field for the components- Returns:
- a new fixed position/velocity at origin
-
toDerivativeStructureVector
public org.hipparchus.geometry.euclidean.threed.FieldVector3D<org.hipparchus.analysis.differentiation.FieldDerivativeStructure<T>> toDerivativeStructureVector(int order)
Transform the instance to aFieldVector3D
<FieldDerivativeStructure
>.The
FieldDerivativeStructure
coordinates correspond to time-derivatives up to the user-specified order.- Parameters:
order
- derivation order for the vector components (must be either 0, 1 or 2)- Returns:
- vector with time-derivatives embedded within the coordinates
- Since:
- 9.2
-
toDerivativeStructurePV
public FieldPVCoordinates<org.hipparchus.analysis.differentiation.FieldDerivativeStructure<T>> toDerivativeStructurePV(int order)
Transform the instance to aFieldPVCoordinates
<FieldDerivativeStructure
>.The
FieldDerivativeStructure
coordinates correspond to time-derivatives up to the user-specified order. As both the instance componentsposition
,velocity
andacceleration
and thederivatives
of the components holds time-derivatives, there are several ways to retrieve these derivatives. If for example theorder
is set to 2, then bothpv.getPosition().getX().getPartialDerivative(2)
,pv.getVelocity().getX().getPartialDerivative(1)
andpv.getAcceleration().getX().getValue()
return the exact same value.If derivation order is 1, the first derivative of acceleration will be computed as a Keplerian-only jerk. If derivation order is 2, the second derivative of velocity (which is also the first derivative of acceleration) will be computed as a Keplerian-only jerk, and the second derivative of acceleration will be computed as a Keplerian-only jounce.
- Parameters:
order
- derivation order for the vector components (must be either 0, 1 or 2)- Returns:
- pv coordinates with time-derivatives embedded within the coordinates
- Since:
- 9.2
-
estimateVelocity
public static <T extends org.hipparchus.RealFieldElement<T>> org.hipparchus.geometry.euclidean.threed.FieldVector3D<T> estimateVelocity(org.hipparchus.geometry.euclidean.threed.FieldVector3D<T> start, org.hipparchus.geometry.euclidean.threed.FieldVector3D<T> end, double dt)
Estimate velocity between two positions.Estimation is based on a simple fixed velocity translation during the time interval between the two positions.
- Type Parameters:
T
- the type of the field elements- Parameters:
start
- start positionend
- end positiondt
- time elapsed between the dates of the two positions- Returns:
- velocity allowing to go from start to end positions
-
shiftedBy
public FieldPVCoordinates<T> shiftedBy(double dt)
Get a time-shifted state.The state can be slightly shifted to close dates. This shift is based on a simple quadratic model. It is not intended as a replacement for proper orbit propagation (it is not even Keplerian!) but should be sufficient for either small time shifts or coarse accuracy.
- Specified by:
shiftedBy
in interfaceTimeShiftable<T extends org.hipparchus.RealFieldElement<T>>
- Parameters:
dt
- time shift in seconds- Returns:
- a new state, shifted with respect to the instance (which is immutable)
-
shiftedBy
public FieldPVCoordinates<T> shiftedBy(T dt)
Get a time-shifted state.The state can be slightly shifted to close dates. This shift is based on a simple quadratic model. It is not intended as a replacement for proper orbit propagation (it is not even Keplerian!) but should be sufficient for either small time shifts or coarse accuracy.
- Parameters:
dt
- time shift in seconds- Returns:
- a new state, shifted with respect to the instance (which is immutable)
-
getPosition
public org.hipparchus.geometry.euclidean.threed.FieldVector3D<T> getPosition()
Gets the position.- Returns:
- the position vector (m).
-
getVelocity
public org.hipparchus.geometry.euclidean.threed.FieldVector3D<T> getVelocity()
Gets the velocity.- Returns:
- the velocity vector (m/s).
-
getAcceleration
public org.hipparchus.geometry.euclidean.threed.FieldVector3D<T> getAcceleration()
Gets the acceleration.- Returns:
- the acceleration vector (m/s²).
-
getMomentum
public org.hipparchus.geometry.euclidean.threed.FieldVector3D<T> getMomentum()
Gets the momentum.This vector is the p ⊗ v where p is position, v is velocity and ⊗ is cross product. To get the real physical angular momentum you need to multiply this vector by the mass.
The returned vector is recomputed each time this method is called, it is not cached.
- Returns:
- a new instance of the momentum vector (m²/s).
-
getAngularVelocity
public org.hipparchus.geometry.euclidean.threed.FieldVector3D<T> getAngularVelocity()
Get the angular velocity (spin) of this point as seen from the origin.The angular velocity vector is parallel to the
angular * momentum
and is computed by ω = p × v / ||p||²- Returns:
- the angular velocity vector
- See Also:
- Angular Velocity on Wikipedia
-
negate
public FieldPVCoordinates<T> negate()
Get the opposite of the instance.- Returns:
- a new position-velocity which is opposite to the instance
-
normalize
public FieldPVCoordinates<T> normalize()
Normalize the position part of the instance.The computed coordinates first component (position) will be a normalized vector, the second component (velocity) will be the derivative of the first component (hence it will generally not be normalized), and the third component (acceleration) will be the derivative of the second component (hence it will generally not be normalized).
- Returns:
- a new instance, with first component normalized and remaining component computed to have consistent derivatives
-
crossProduct
public FieldPVCoordinates<T> crossProduct(FieldPVCoordinates<T> pv2)
Compute the cross-product of two instances.- Parameters:
pv2
- second instances- Returns:
- the cross product v1 ^ v2 as a new instance
-
toPVCoordinates
public PVCoordinates toPVCoordinates()
Convert to a constant position-velocity.- Returns:
- a constant position-velocity
-
-