org.orekit.frames
public class Transform extends Object implements TimeStamped, TimeShiftable<Transform>, TimeInterpolable<Transform>, Serializable
This class represents the transformation engine between frames
.
It is used both to define the relationship between each frame and its
parent frame and to gather all individual transforms into one
operation when converting between frames far away from each other.
The convention used in OREKIT is vectorial transformation. It means that a transformation is defined as a transform to apply to the coordinates of a vector expressed in the old frame to obtain the same vector expressed in the new frame.
Instances of this class are guaranteed to be immutable.
1 ) Example of translation from RA to RB: We want to transform thePVCoordinates
PVA to PVB. With : PVA = ({1, 0, 0} , {1, 0, 0}); and : PVB = ({0, 0, 0} , {0, 0, 0}); The transform to apply then is defined as follows : Vector3D translation = new Vector3D(-1,0,0); Vector3D velocity = new Vector3D(-1,0,0); Transform R1toR2 = new Transform(translation, Velocity); PVB = R1toR2.transformPVCoordinates(PVA); 2 ) Example of rotation from RA to RB: We want to transform thePVCoordinates
PVA to PVB. With : PVA = ({1, 0, 0}, {1, 0, 0}); and : PVB = ({0, 1, 0}, {-2, 1, 0}); The transform to apply then is defined as follows : Rotation rotation = new Rotation(Vector3D.PLUS_K, FastMath.PI / 2); Vector3D rotationRate = new Vector3D(0, 0, -2); Transform R1toR2 = new Transform(rotation, rotationRate); PVB = R1toR2.transformPVCoordinates(PVA);
Modifier and Type | Field and Description |
---|---|
static Transform |
IDENTITY
Identity transform.
|
Constructor and Description |
---|
Transform(AbsoluteDate date,
AngularCoordinates angular)
Build a rotation transform.
|
Transform(AbsoluteDate date,
PVCoordinates cartesian)
Build a translation transform, with its first time derivative.
|
Transform(AbsoluteDate date,
Rotation rotation)
Build a rotation transform.
|
Transform(AbsoluteDate date,
Rotation rotation,
Vector3D rotationRate)
Build a rotation transform.
|
Transform(AbsoluteDate date,
Transform first,
Transform second)
Build a transform by combining two existing ones.
|
Transform(AbsoluteDate date,
Vector3D translation)
Build a translation transform.
|
Transform(AbsoluteDate date,
Vector3D translation,
Vector3D velocity)
Build a translation transform, with its first time derivative.
|
Modifier and Type | Method and Description |
---|---|
Transform |
freeze()
Get a freezed transform.
|
AngularCoordinates |
getAngular()
Get the underlying elementary angular part.
|
PVCoordinates |
getCartesian()
Get the underlying elementary cartesian part.
|
AbsoluteDate |
getDate()
Get the date.
|
Transform |
getInverse()
Get the inverse transform of the instance.
|
void |
getJacobian(double[][] jacobian)
Compute the Jacobian of the
transformPVCoordinates(PVCoordinates)
method of the transform. |
Rotation |
getRotation()
Get the underlying elementary rotation.
|
Vector3D |
getRotationRate()
Get the first time derivative of the rotation.
|
Vector3D |
getTranslation()
Get the underlying elementary translation.
|
Vector3D |
getVelocity()
Get the first time derivative of the translation.
|
static Transform |
interpolate(AbsoluteDate date,
boolean useVelocities,
boolean useRotationRates,
Collection<Transform> sample)
Interpolate a transform from a sample set of existing transforms.
|
Transform |
interpolate(AbsoluteDate interpolationDate,
Collection<Transform> sample)
Get an interpolated instance.
|
Transform |
shiftedBy(double dt)
Get a time-shifted instance.
|
Line |
transformLine(Line line)
Transform a line.
|
<T extends RealFieldElement<T>> |
transformPosition(FieldVector3D<T> position)
Transform a position vector (including translation effects).
|
Vector3D |
transformPosition(Vector3D position)
Transform a position vector (including translation effects).
|
<T extends RealFieldElement<T>> |
transformPVCoordinates(FieldPVCoordinates<T> pv)
Transform
FieldPVCoordinates including kinematic effects. |
PVCoordinates |
transformPVCoordinates(PVCoordinates pv)
Transform
PVCoordinates including kinematic effects. |
<T extends RealFieldElement<T>> |
transformVector(FieldVector3D<T> vector)
Transform a vector (ignoring translation effects).
|
Vector3D |
transformVector(Vector3D vector)
Transform a vector (ignoring translation effects).
|
public static final Transform IDENTITY
public Transform(AbsoluteDate date, Vector3D translation)
date
- date of the transformtranslation
- translation to apply (i.e. coordinates of
the transformed origin, or coordinates of the origin of the
old frame in the new frame)public Transform(AbsoluteDate date, Rotation rotation)
date
- date of the transformrotation
- rotation to apply ( i.e. rotation to apply to the
coordinates of a vector expressed in the old frame to obtain the
same vector expressed in the new frame )public Transform(AbsoluteDate date, Vector3D translation, Vector3D velocity)
date
- date of the transformtranslation
- translation to apply (i.e. coordinates of
the transformed origin, or coordinates of the origin of the
old frame in the new frame)velocity
- the velocity of the translation (i.e. origin
of the old frame velocity in the new frame)public Transform(AbsoluteDate date, PVCoordinates cartesian)
date
- date of the transformcartesian
- cartesian part of the transformation to apply (i.e. coordinates of
the transformed origin, or coordinates of the origin of the
old frame in the new frame, with their derivatives)public Transform(AbsoluteDate date, Rotation rotation, Vector3D rotationRate)
date
- date of the transformrotation
- rotation to apply ( i.e. rotation to apply to the
coordinates of a vector expressed in the old frame to obtain the
same vector expressed in the new frame )rotationRate
- the axis of the instant rotation
expressed in the new frame. (norm representing angular rate)public Transform(AbsoluteDate date, AngularCoordinates angular)
date
- date of the transformangular
- angular part of the transformation to apply (i.e. rotation to
apply to the coordinates of a vector expressed in the old frame to obtain the
same vector expressed in the new frame, with its rotation rate)public Transform(AbsoluteDate date, Transform first, Transform second)
Note that the dates of the two existing transformed are ignored, and the combined transform date is set to the date supplied in this constructor without any attempt to shift the raw transforms. This is a design choice allowing user full control of the combination.
date
- date of the transformfirst
- first transform appliedsecond
- second transform appliedpublic AbsoluteDate getDate()
getDate
in interface TimeStamped
public Transform shiftedBy(double dt)
shiftedBy
in interface TimeShiftable<Transform>
dt
- time shift in secondspublic Transform interpolate(AbsoluteDate interpolationDate, Collection<Transform> sample)
Note that the state of the current instance may not be used in the interpolation process, only its type and non interpolable fields are used (for example central attraction coefficient or frame when interpolating orbits). The interpolable fields taken into account are taken only from the states of the sample points. So if the state of the instance must be used, the instance should be included in the sample points.
Note that this method is designed for small samples only (say up to about 10-20 points) so it can be implemented using polynomial interpolation (typically Hermite interpolation). Using too much points may induce Runge's phenomenon and numerical problems (including NaN appearing).
Calling this method is equivalent to call interpolate(AbsoluteDate, boolean,
boolean, Collection)
with both useVelocities
and useRotationRates
set to true.
interpolate
in interface TimeInterpolable<Transform>
interpolationDate
- interpolation datesample
- sample points on which interpolation should be donepublic static Transform interpolate(AbsoluteDate date, boolean useVelocities, boolean useRotationRates, Collection<Transform> sample)
Note that even if first time derivatives (velocities and rotation rates) from sample can be ignored, the interpolated instance always includes interpolated derivatives. This feature can be used explicitly to compute these derivatives when it would be too complex to compute them from an analytical formula: just compute a few sample points from the explicit formula and set the derivatives to zero in these sample points, then use interpolation to add derivatives consistent with the positions and rotations.
As this implementation of interpolation is polynomial, it should be used only with small samples (about 10-20 points) in order to avoid Runge's phenomenon and numerical problems (including NaN appearing).
date
- interpolation dateuseVelocities
- if true, use sample transforms velocities,
otherwise ignore them and use only positionsuseRotationRates
- if true, use sample points rotation rates,
otherwise ignore them and use only rotationssample
- sample points on which interpolation should be donepublic Transform getInverse()
public Transform freeze()
This method creates a copy of the instance but frozen in time, i.e. with velocity and rotation rate forced to zero.
public Vector3D transformPosition(Vector3D position)
position
- vector to transformpublic <T extends RealFieldElement<T>> FieldVector3D<T> transformPosition(FieldVector3D<T> position)
T
- the type of the field elementsposition
- vector to transformpublic Vector3D transformVector(Vector3D vector)
vector
- vector to transformpublic <T extends RealFieldElement<T>> FieldVector3D<T> transformVector(FieldVector3D<T> vector)
T
- the type of the field elementsvector
- vector to transformpublic Line transformLine(Line line)
line
- to transformpublic PVCoordinates transformPVCoordinates(PVCoordinates pv)
PVCoordinates
including kinematic effects.pv
- the couple position-velocity to transform.public <T extends RealFieldElement<T>> FieldPVCoordinates<T> transformPVCoordinates(FieldPVCoordinates<T> pv)
FieldPVCoordinates
including kinematic effects.T
- the type of the field elementspv
- the couple position-velocity to transform.public void getJacobian(double[][] jacobian)
transformPVCoordinates(PVCoordinates)
method of the transform.
Element jacobian[i][j]
is the derivative of Cartesian coordinate i
of the transformed PVCoordinates
with respect to Cartesian coordinate j
of the input PVCoordinates
in method transformPVCoordinates(PVCoordinates)
.
This definition implies that if we define position-velocity coordinates
PV1 = transform.transformPVCoordinates(PV0), thentheir differentials dPV1 and dPV0 will obey the following relation where J is the matrix computed by this method:
dPV1 = J × dPV0
jacobian
- placeholder 6x6 (or larger) matrix to be filled with the Jacobian, if matrix
is larger than 6x6, only the 6x6 upper left corner will be modifiedpublic PVCoordinates getCartesian()
A transform can be uniquely represented as an elementary translation followed by an elementary rotation. This method returns this unique elementary translation with its derivative.
getTranslation()
,
getVelocity()
public Vector3D getTranslation()
A transform can be uniquely represented as an elementary translation followed by an elementary rotation. This method returns this unique elementary translation.
getCartesian()
,
getVelocity()
public Vector3D getVelocity()
getCartesian()
,
getTranslation()
public AngularCoordinates getAngular()
A transform can be uniquely represented as an elementary translation followed by an elementary rotation. This method returns this unique elementary rotation with its derivative.
getRotation()
,
getRotationRate()
public Rotation getRotation()
A transform can be uniquely represented as an elementary translation followed by an elementary rotation. This method returns this unique elementary rotation.
getAngular()
,
getRotationRate()
public Vector3D getRotationRate()
The norm represents the angular rate.
getAngular()
,
getRotation()
Copyright © 2002–2015 CS Syst?mes d'Information. All rights reserved.