Class FieldAngularCoordinates<T extends CalculusFieldElement<T>>
- java.lang.Object
-
- org.orekit.utils.FieldAngularCoordinates<T>
-
- Type Parameters:
T
- the type of the field elements
- All Implemented Interfaces:
FieldTimeShiftable<FieldAngularCoordinates<T>,T>
,TimeShiftable<FieldAngularCoordinates<T>>
- Direct Known Subclasses:
TimeStampedFieldAngularCoordinates
public class FieldAngularCoordinates<T extends CalculusFieldElement<T>> extends Object implements FieldTimeShiftable<FieldAngularCoordinates<T>,T>
Simple container for rotation / rotation rate pairs, usingCalculusFieldElement
.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 attitude propagation but should be sufficient for either small time shifts or coarse accuracy.
This class is the angular counterpart to
FieldPVCoordinates
.Instances of this class are guaranteed to be immutable.
- Since:
- 6.0
- Author:
- Luc Maisonobe
- See Also:
AngularCoordinates
-
-
Constructor Summary
Constructors Constructor Description FieldAngularCoordinates(Field<T> field, AngularCoordinates ang)
Builds a FieldAngularCoordinates from a field and a regular AngularCoordinates.FieldAngularCoordinates(FieldRotation<T> rotation, FieldVector3D<T> rotationRate)
Builds a rotation/rotation rate pair.FieldAngularCoordinates(FieldRotation<T> rotation, FieldVector3D<T> rotationRate, FieldVector3D<T> rotationAcceleration)
Builds a rotation / rotation rate / rotation acceleration triplet.FieldAngularCoordinates(FieldRotation<U> r)
Builds a FieldAngularCoordinates from aFieldRotation
<FieldDerivativeStructure
>.FieldAngularCoordinates(FieldPVCoordinates<T> u1, FieldPVCoordinates<T> u2, FieldPVCoordinates<T> v1, FieldPVCoordinates<T> v2, double tolerance)
Build the rotation that transforms a pair of pv coordinates into another one.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description FieldAngularCoordinates<T>
addOffset(FieldAngularCoordinates<T> offset)
Add an offset from the instance.FieldPVCoordinates<T>
applyTo(FieldPVCoordinates<T> pv)
Apply the rotation to a pv coordinates.FieldPVCoordinates<T>
applyTo(PVCoordinates pv)
Apply the rotation to a pv coordinates.TimeStampedFieldPVCoordinates<T>
applyTo(TimeStampedFieldPVCoordinates<T> pv)
Apply the rotation to a pv coordinates.TimeStampedFieldPVCoordinates<T>
applyTo(TimeStampedPVCoordinates pv)
Apply the rotation to a pv coordinates.static <T extends CalculusFieldElement<T>>
FieldAngularCoordinates<T>createFromModifiedRodrigues(T[][] r)
Convert a modified Rodrigues vector and derivatives to angular coordinates.static <T extends CalculusFieldElement<T>>
FieldVector3D<T>estimateRate(FieldRotation<T> start, FieldRotation<T> end, double dt)
Estimate rotation rate between two orientations.static <T extends CalculusFieldElement<T>>
FieldVector3D<T>estimateRate(FieldRotation<T> start, FieldRotation<T> end, T dt)
Estimate rotation rate between two orientations.static <T extends CalculusFieldElement<T>>
FieldAngularCoordinates<T>getIdentity(Field<T> field)
Fixed orientation parallel with reference frame (identity rotation, zero rotation rate and acceleration).T[][]
getModifiedRodrigues(double sign)
Convert rotation, rate and acceleration to modified Rodrigues vector and derivatives.FieldRotation<T>
getRotation()
Get the rotation.FieldVector3D<T>
getRotationAcceleration()
Get the rotation acceleration.FieldVector3D<T>
getRotationRate()
Get the rotation rate.FieldAngularCoordinates<T>
revert()
Revert a rotation / rotation rate / rotation acceleration triplet.FieldRotation<T>
rotationShiftedBy(T dt)
Get a time-shifted rotation.FieldAngularCoordinates<T>
shiftedBy(double dt)
Get a time-shifted state.FieldAngularCoordinates<T>
shiftedBy(T dt)
Get a time-shifted state.FieldAngularCoordinates<T>
subtractOffset(FieldAngularCoordinates<T> offset)
Subtract an offset from the instance.AngularCoordinates
toAngularCoordinates()
Convert to a regular angular coordinates.FieldRotation<FieldDerivativeStructure<T>>
toDerivativeStructureRotation(int order)
Transform the instance to aFieldRotation
<FieldDerivativeStructure
>.FieldRotation<FieldUnivariateDerivative1<T>>
toUnivariateDerivative1Rotation()
Transform the instance to aFieldRotation
<UnivariateDerivative1
>.FieldRotation<FieldUnivariateDerivative2<T>>
toUnivariateDerivative2Rotation()
Transform the instance to aFieldRotation
<UnivariateDerivative2
>.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.orekit.time.TimeShiftable
shiftedBy
-
-
-
-
Constructor Detail
-
FieldAngularCoordinates
public FieldAngularCoordinates(FieldRotation<T> rotation, FieldVector3D<T> rotationRate)
Builds a rotation/rotation rate pair.- Parameters:
rotation
- rotationrotationRate
- rotation rate Ω (rad/s)
-
FieldAngularCoordinates
public FieldAngularCoordinates(FieldRotation<T> rotation, FieldVector3D<T> rotationRate, FieldVector3D<T> rotationAcceleration)
Builds a rotation / rotation rate / rotation acceleration triplet.- Parameters:
rotation
- i.e. the orientation of the vehiclerotationRate
- rotation rate Ω, i.e. the spin vector (rad/s)rotationAcceleration
- angular acceleration vector dΩ/dt (rad/s²)
-
FieldAngularCoordinates
public FieldAngularCoordinates(FieldPVCoordinates<T> u1, FieldPVCoordinates<T> u2, FieldPVCoordinates<T> v1, FieldPVCoordinates<T> v2, double tolerance)
Build the rotation that transforms a pair of pv coordinates into another one.WARNING! This method requires much more stringent assumptions on its parameters than the similar
constructor
from theFieldRotation
class. As far as the FieldRotation constructor is concerned, thev₂
vector from the second pair can be slightly misaligned. The FieldRotation constructor will compensate for this misalignment and create a rotation that ensurev₁ = r(u₁)
andv₂ ∈ plane (r(u₁), r(u₂))
. THIS IS NOT TRUE ANYMORE IN THIS CLASS! As derivatives are involved and must be preserved, this constructor works only if the two pairs are fully consistent, i.e. if a rotation exists that fulfill all the requirements:v₁ = r(u₁)
,v₂ = r(u₂)
,dv₁/dt = dr(u₁)/dt
,dv₂/dt = dr(u₂)/dt
,d²v₁/dt² = d²r(u₁)/dt²
,d²v₂/dt² = d²r(u₂)/dt²
.- Parameters:
u1
- first vector of the origin pairu2
- second vector of the origin pairv1
- desired image of u1 by the rotationv2
- desired image of u2 by the rotationtolerance
- relative tolerance factor used to check singularities
-
FieldAngularCoordinates
public FieldAngularCoordinates(Field<T> field, AngularCoordinates ang)
Builds a FieldAngularCoordinates from a field and a regular AngularCoordinates.- Parameters:
field
- field for the componentsang
- AngularCoordinates to convert
-
FieldAngularCoordinates
public FieldAngularCoordinates(FieldRotation<U> r)
Builds a FieldAngularCoordinates from aFieldRotation
<FieldDerivativeStructure
>.The rotation components must have time as their only derivation parameter and have consistent derivation orders.
- Type Parameters:
U
- type of the derivative- Parameters:
r
- rotation with time-derivatives embedded within the coordinates- Since:
- 9.2
-
-
Method Detail
-
getIdentity
public static <T extends CalculusFieldElement<T>> FieldAngularCoordinates<T> getIdentity(Field<T> field)
Fixed orientation parallel with reference frame (identity rotation, zero rotation rate and acceleration).- Type Parameters:
T
- the type of the field elements- Parameters:
field
- field for the components- Returns:
- a new fixed orientation parallel with reference frame
-
toDerivativeStructureRotation
public FieldRotation<FieldDerivativeStructure<T>> toDerivativeStructureRotation(int order)
Transform the instance to aFieldRotation
<FieldDerivativeStructure
>.The
FieldDerivativeStructure
coordinates correspond to time-derivatives up to the user-specified order.- Parameters:
order
- derivation order for the vector components- Returns:
- rotation with time-derivatives embedded within the coordinates
- Since:
- 9.2
-
toUnivariateDerivative1Rotation
public FieldRotation<FieldUnivariateDerivative1<T>> toUnivariateDerivative1Rotation()
Transform the instance to aFieldRotation
<UnivariateDerivative1
>.The
UnivariateDerivative1
coordinates correspond to time-derivatives up to the order 1.- Returns:
- rotation with time-derivatives embedded within the coordinates
-
toUnivariateDerivative2Rotation
public FieldRotation<FieldUnivariateDerivative2<T>> toUnivariateDerivative2Rotation()
Transform the instance to aFieldRotation
<UnivariateDerivative2
>.The
UnivariateDerivative2
coordinates correspond to time-derivatives up to the order 2.- Returns:
- rotation with time-derivatives embedded within the coordinates
-
estimateRate
public static <T extends CalculusFieldElement<T>> FieldVector3D<T> estimateRate(FieldRotation<T> start, FieldRotation<T> end, double dt)
Estimate rotation rate between two orientations.Estimation is based on a simple fixed rate rotation during the time interval between the two orientations.
- Type Parameters:
T
- the type of the field elements- Parameters:
start
- start orientationend
- end orientationdt
- time elapsed between the dates of the two orientations- Returns:
- rotation rate allowing to go from start to end orientations
-
estimateRate
public static <T extends CalculusFieldElement<T>> FieldVector3D<T> estimateRate(FieldRotation<T> start, FieldRotation<T> end, T dt)
Estimate rotation rate between two orientations.Estimation is based on a simple fixed rate rotation during the time interval between the two orientations.
- Type Parameters:
T
- the type of the field elements- Parameters:
start
- start orientationend
- end orientationdt
- time elapsed between the dates of the two orientations- Returns:
- rotation rate allowing to go from start to end orientations
-
revert
public FieldAngularCoordinates<T> revert()
Revert a rotation / rotation rate / rotation acceleration triplet.Build a triplet which reverse the effect of another triplet.
- Returns:
- a new triplet whose effect is the reverse of the effect of the instance
-
rotationShiftedBy
public FieldRotation<T> rotationShiftedBy(T dt)
Get a time-shifted rotation. Same asshiftedBy(double)
except only the shifted rotation is computed.The state can be slightly shifted to close dates. This shift is based on an approximate solution of the fixed acceleration motion. It is not intended as a replacement for proper attitude propagation 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)
- Since:
- 11.2
- See Also:
shiftedBy(CalculusFieldElement)
-
shiftedBy
public FieldAngularCoordinates<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 attitude propagation but should be sufficient for either small time shifts or coarse accuracy.
- Specified by:
shiftedBy
in interfaceTimeShiftable<T extends CalculusFieldElement<T>>
- Parameters:
dt
- time shift in seconds- Returns:
- a new state, shifted with respect to the instance (which is immutable)
-
shiftedBy
public FieldAngularCoordinates<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 attitude propagation but should be sufficient for either small time shifts or coarse accuracy.
- Specified by:
shiftedBy
in interfaceFieldTimeShiftable<FieldAngularCoordinates<T extends CalculusFieldElement<T>>,T extends CalculusFieldElement<T>>
- Parameters:
dt
- time shift in seconds- Returns:
- a new state, shifted with respect to the instance (which is immutable)
-
getRotation
public FieldRotation<T> getRotation()
Get the rotation.- Returns:
- the rotation.
-
getRotationRate
public FieldVector3D<T> getRotationRate()
Get the rotation rate.- Returns:
- the rotation rate vector (rad/s).
-
getRotationAcceleration
public FieldVector3D<T> getRotationAcceleration()
Get the rotation acceleration.- Returns:
- the rotation acceleration vector dΩ/dt (rad/s²).
-
addOffset
public FieldAngularCoordinates<T> addOffset(FieldAngularCoordinates<T> offset)
Add an offset from the instance.We consider here that the offset rotation is applied first and the instance is applied afterward. Note that angular coordinates do not commute under this operation, i.e.
a.addOffset(b)
andb.addOffset(a)
lead to different results in most cases.The two methods
addOffset
andsubtractOffset
are designed so that round trip applications are possible. This means that bothac1.subtractOffset(ac2).addOffset(ac2)
andac1.addOffset(ac2).subtractOffset(ac2)
return angular coordinates equal to ac1.- Parameters:
offset
- offset to subtract- Returns:
- new instance, with offset subtracted
- See Also:
subtractOffset(FieldAngularCoordinates)
-
subtractOffset
public FieldAngularCoordinates<T> subtractOffset(FieldAngularCoordinates<T> offset)
Subtract an offset from the instance.We consider here that the offset Rotation is applied first and the instance is applied afterward. Note that angular coordinates do not commute under this operation, i.e.
a.subtractOffset(b)
andb.subtractOffset(a)
lead to different results in most cases.The two methods
addOffset
andsubtractOffset
are designed so that round trip applications are possible. This means that bothac1.subtractOffset(ac2).addOffset(ac2)
andac1.addOffset(ac2).subtractOffset(ac2)
return angular coordinates equal to ac1.- Parameters:
offset
- offset to subtract- Returns:
- new instance, with offset subtracted
- See Also:
addOffset(FieldAngularCoordinates)
-
toAngularCoordinates
public AngularCoordinates toAngularCoordinates()
Convert to a regular angular coordinates.- Returns:
- a regular angular coordinates
-
applyTo
public FieldPVCoordinates<T> applyTo(PVCoordinates pv)
Apply the rotation to a pv coordinates.- Parameters:
pv
- vector to apply the rotation to- Returns:
- a new pv coordinates which is the image of pv by the rotation
-
applyTo
public TimeStampedFieldPVCoordinates<T> applyTo(TimeStampedPVCoordinates pv)
Apply the rotation to a pv coordinates.- Parameters:
pv
- vector to apply the rotation to- Returns:
- a new pv coordinates which is the image of pv by the rotation
-
applyTo
public FieldPVCoordinates<T> applyTo(FieldPVCoordinates<T> pv)
Apply the rotation to a pv coordinates.- Parameters:
pv
- vector to apply the rotation to- Returns:
- a new pv coordinates which is the image of pv by the rotation
- Since:
- 9.0
-
applyTo
public TimeStampedFieldPVCoordinates<T> applyTo(TimeStampedFieldPVCoordinates<T> pv)
Apply the rotation to a pv coordinates.- Parameters:
pv
- vector to apply the rotation to- Returns:
- a new pv coordinates which is the image of pv by the rotation
- Since:
- 9.0
-
getModifiedRodrigues
public T[][] getModifiedRodrigues(double sign)
Convert rotation, rate and acceleration to modified Rodrigues vector and derivatives.The modified Rodrigues vector is tan(θ/4) u where θ and u are the rotation angle and axis respectively.
- Parameters:
sign
- multiplicative sign for quaternion components- Returns:
- modified Rodrigues vector and derivatives (vector on row 0, first derivative on row 1, second derivative on row 2)
- Since:
- 9.0
- See Also:
createFromModifiedRodrigues(CalculusFieldElement[][])
-
createFromModifiedRodrigues
public static <T extends CalculusFieldElement<T>> FieldAngularCoordinates<T> createFromModifiedRodrigues(T[][] r)
Convert a modified Rodrigues vector and derivatives to angular coordinates.- Type Parameters:
T
- the type of the field elements- Parameters:
r
- modified Rodrigues vector (with first and second times derivatives)- Returns:
- angular coordinates
- Since:
- 9.0
- See Also:
getModifiedRodrigues(double)
-
-