public class PVCoordinates extends Object implements TimeShiftable<PVCoordinates>, Serializable
Simple container for Position/Velocity/Acceleration triplets.
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.
This class is the angular counterpart to AngularCoordinates
.
Instances of this class are guaranteed to be immutable.
Modifier and Type | Field and Description |
---|---|
static PVCoordinates |
ZERO
Fixed position/velocity/acceleration at origin (both p, v and a are zero vectors).
|
Constructor and Description |
---|
PVCoordinates()
Simple constructor.
|
PVCoordinates(double a,
PVCoordinates pv)
Multiplicative constructor.
|
PVCoordinates(double a1,
PVCoordinates pv1,
double a2,
PVCoordinates pv2)
Linear constructor.
|
PVCoordinates(double a1,
PVCoordinates pv1,
double a2,
PVCoordinates pv2,
double a3,
PVCoordinates pv3)
Linear constructor.
|
PVCoordinates(double a1,
PVCoordinates pv1,
double a2,
PVCoordinates pv2,
double a3,
PVCoordinates pv3,
double a4,
PVCoordinates pv4)
Linear constructor.
|
PVCoordinates(FieldVector3D<DerivativeStructure> p)
Builds a PVCoordinates triplet from a
FieldVector3D <DerivativeStructure >. |
PVCoordinates(PVCoordinates start,
PVCoordinates end)
Subtractive constructor.
|
PVCoordinates(Vector3D positionIn,
Vector3D velocityIn)
Builds a PVCoordinates triplet with zero acceleration.
|
PVCoordinates(Vector3D positionIn,
Vector3D velocityIn,
Vector3D accelerationIn)
Builds a PVCoordinates triplet.
|
Modifier and Type | Method and Description |
---|---|
static PVCoordinates |
crossProduct(PVCoordinates pv1,
PVCoordinates pv2)
Compute the cross-product of two instances.
|
static Vector3D |
estimateVelocity(Vector3D start,
Vector3D end,
double dt)
Estimate velocity between two positions.
|
Vector3D |
getAcceleration()
Gets the acceleration.
|
Vector3D |
getAngularVelocity()
Get the angular velocity (spin) of this point as seen from the origin.
|
Vector3D |
getMomentum()
Gets the momentum.
|
Vector3D |
getPosition()
Gets the position.
|
Vector3D |
getVelocity()
Gets the velocity.
|
PVCoordinates |
negate()
Get the opposite of the instance.
|
PVCoordinates |
normalize()
Normalize the position part of the instance.
|
PVCoordinates |
shiftedBy(double dt)
Get a time-shifted state.
|
FieldVector3D<DerivativeStructure> |
toDerivativeStructureVector(int order)
Transform the instance to a
FieldVector3D <DerivativeStructure >. |
String |
toString()
Return a string representation of this position/velocity/acceleration triplet.
|
public static final PVCoordinates ZERO
public PVCoordinates()
Sets the Coordinates to default : (0 0 0) (0 0 0) (0 0 0).
public PVCoordinates(Vector3D positionIn, Vector3D velocityIn)
positionIn
- the position vector (m)velocityIn
- the velocity vector (m/s)public PVCoordinates(Vector3D positionIn, Vector3D velocityIn, Vector3D accelerationIn)
positionIn
- the position vector (m)velocityIn
- the velocity vector (m/s)accelerationIn
- the acceleration vector (m/s²)public PVCoordinates(double a, PVCoordinates pv)
Build a PVCoordinates from another one and a scale factor.
The PVCoordinates built will be a * pv
a
- scale factorpv
- base (unscaled) PVCoordinatespublic PVCoordinates(PVCoordinates start, PVCoordinates end)
Build a relative PVCoordinates from a start and an end position.
The PVCoordinates built will be end - start.
start
- Starting PVCoordinatesend
- ending PVCoordinatespublic PVCoordinates(double a1, PVCoordinates pv1, double a2, PVCoordinates pv2)
Build a PVCoordinates from two other ones and corresponding scale factors.
The PVCoordinates built will be a1 * u1 + a2 * u2
a1
- first scale factorpv1
- first base (unscaled) PVCoordinatesa2
- second scale factorpv2
- second base (unscaled) PVCoordinatespublic PVCoordinates(double a1, PVCoordinates pv1, double a2, PVCoordinates pv2, double a3, PVCoordinates pv3)
Build a PVCoordinates from three other ones and corresponding scale factors.
The PVCoordinates built will be a1 * u1 + a2 * u2 + a3 * u3
a1
- first scale factorpv1
- first base (unscaled) PVCoordinatesa2
- second scale factorpv2
- second base (unscaled) PVCoordinatesa3
- third scale factorpv3
- third base (unscaled) PVCoordinatespublic PVCoordinates(double a1, PVCoordinates pv1, double a2, PVCoordinates pv2, double a3, PVCoordinates pv3, double a4, PVCoordinates pv4)
Build a PVCoordinates from four other ones and corresponding scale factors.
The PVCoordinates built will be a1 * u1 + a2 * u2 + a3 * u3 + a4 * u4
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) PVCoordinatespublic PVCoordinates(FieldVector3D<DerivativeStructure> p)
FieldVector3D
<DerivativeStructure
>.
The vector components must have time as their only derivation parameter and have consistent derivation orders.
p
- vector with time-derivatives embedded within the coordinatespublic FieldVector3D<DerivativeStructure> toDerivativeStructureVector(int order) throws PatriusException
FieldVector3D
<DerivativeStructure
>.
The DerivativeStructure
coordinates correspond to time-derivatives up to the user-specified order.
order
- derivation order for the vector componentsPatriusException
- if the user specified order is too largepublic static Vector3D estimateVelocity(Vector3D start, Vector3D end, double dt)
Estimation is based on a simple fixed velocity translation during the time interval between the two positions.
start
- start positionend
- end positiondt
- time elapsed between the dates of the two positionspublic PVCoordinates shiftedBy(double dt)
The state can be slightly shifted to close dates. This shift is based on a simple Taylor expansion. 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.
shiftedBy
in interface TimeShiftable<PVCoordinates>
dt
- time shift in secondsAbsoluteDate.shiftedBy(double)
,
Attitude.shiftedBy(double)
,
Orbit.shiftedBy(double)
,
SpacecraftState.shiftedBy(double)
public Vector3D getPosition()
public Vector3D getVelocity()
public Vector3D getAcceleration()
public Vector3D getMomentum()
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.
public Vector3D getAngularVelocity()
angular
momentum
and is computed by ω = p × v / ||p||²public PVCoordinates negate()
public static PVCoordinates crossProduct(PVCoordinates pv1, PVCoordinates pv2)
pv1
- first instancespv2
- second instancespublic PVCoordinates normalize()
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).
Copyright © 2019 CNES. All rights reserved.