Class AngularCoordinates
- java.lang.Object
-
- org.orekit.utils.AngularCoordinates
-
- All Implemented Interfaces:
Serializable
,TimeShiftable<AngularCoordinates>
- Direct Known Subclasses:
TimeStampedAngularCoordinates
public class AngularCoordinates extends Object implements TimeShiftable<AngularCoordinates>, Serializable
Simple container for rotation/rotation rate/rotation acceleration triplets.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.
This class is the angular counterpart to
PVCoordinates
.Instances of this class are guaranteed to be immutable.
- Author:
- Luc Maisonobe
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static AngularCoordinates
IDENTITY
Fixed orientation parallel with reference frame (identity rotation, zero rotation rate and acceleration).
-
Constructor Summary
Constructors Constructor Description AngularCoordinates()
Simple constructor.AngularCoordinates(org.hipparchus.geometry.euclidean.threed.FieldRotation<org.hipparchus.analysis.differentiation.DerivativeStructure> r)
Builds a AngularCoordinates from aFieldRotation
<DerivativeStructure
>.AngularCoordinates(org.hipparchus.geometry.euclidean.threed.Rotation rotation, org.hipparchus.geometry.euclidean.threed.Vector3D rotationRate)
Builds a rotation/rotation rate pair.AngularCoordinates(org.hipparchus.geometry.euclidean.threed.Rotation rotation, org.hipparchus.geometry.euclidean.threed.Vector3D rotationRate, org.hipparchus.geometry.euclidean.threed.Vector3D rotationAcceleration)
Builds a rotation/rotation rate/rotation acceleration triplet.AngularCoordinates(PVCoordinates u, PVCoordinates v)
Build one of the rotations that transform one pv coordinates into another one.AngularCoordinates(PVCoordinates u1, PVCoordinates u2, PVCoordinates v1, PVCoordinates 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 AngularCoordinates
addOffset(AngularCoordinates offset)
Add an offset from the instance.<T extends org.hipparchus.RealFieldElement<T>>
FieldPVCoordinates<T>applyTo(FieldPVCoordinates<T> pv)
Apply the rotation to a pv coordinates.PVCoordinates
applyTo(PVCoordinates pv)
Apply the rotation to a pv coordinates.<T extends org.hipparchus.RealFieldElement<T>>
TimeStampedFieldPVCoordinates<T>applyTo(TimeStampedFieldPVCoordinates<T> pv)
Apply the rotation to a pv coordinates.TimeStampedPVCoordinates
applyTo(TimeStampedPVCoordinates pv)
Apply the rotation to a pv coordinates.static AngularCoordinates
createFromModifiedRodrigues(double[][] r)
Convert a modified Rodrigues vector and derivatives to angular coordinates.static org.hipparchus.geometry.euclidean.threed.Vector3D
estimateRate(org.hipparchus.geometry.euclidean.threed.Rotation start, org.hipparchus.geometry.euclidean.threed.Rotation end, double dt)
Estimate rotation rate between two orientations.double[][]
getModifiedRodrigues(double sign)
Convert rotation, rate and acceleration to modified Rodrigues vector and derivatives.org.hipparchus.geometry.euclidean.threed.Rotation
getRotation()
Get the rotation.org.hipparchus.geometry.euclidean.threed.Vector3D
getRotationAcceleration()
Get the rotation acceleration.org.hipparchus.geometry.euclidean.threed.Vector3D
getRotationRate()
Get the rotation rate.AngularCoordinates
revert()
Revert a rotation/rotation rate/ rotation acceleration triplet.AngularCoordinates
shiftedBy(double dt)
Get a time-shifted state.AngularCoordinates
subtractOffset(AngularCoordinates offset)
Subtract an offset from the instance.org.hipparchus.geometry.euclidean.threed.FieldRotation<org.hipparchus.analysis.differentiation.DerivativeStructure>
toDerivativeStructureRotation(int order)
Transform the instance to aFieldRotation
<DerivativeStructure
>.
-
-
-
Field Detail
-
IDENTITY
public static final AngularCoordinates IDENTITY
Fixed orientation parallel with reference frame (identity rotation, zero rotation rate and acceleration).
-
-
Constructor Detail
-
AngularCoordinates
public AngularCoordinates()
Simple constructor.Sets the Coordinates to default : Identity, Ω = (0 0 0), dΩ/dt = (0 0 0).
-
AngularCoordinates
public AngularCoordinates(org.hipparchus.geometry.euclidean.threed.Rotation rotation, org.hipparchus.geometry.euclidean.threed.Vector3D rotationRate)
Builds a rotation/rotation rate pair.- Parameters:
rotation
- rotationrotationRate
- rotation rate Ω (rad/s)
-
AngularCoordinates
public AngularCoordinates(org.hipparchus.geometry.euclidean.threed.Rotation rotation, org.hipparchus.geometry.euclidean.threed.Vector3D rotationRate, org.hipparchus.geometry.euclidean.threed.Vector3D rotationAcceleration)
Builds a rotation/rotation rate/rotation acceleration triplet.- Parameters:
rotation
- rotationrotationRate
- rotation rate Ω (rad/s)rotationAcceleration
- rotation acceleration dΩ/dt (rad²/s²)
-
AngularCoordinates
public AngularCoordinates(PVCoordinates u1, PVCoordinates u2, PVCoordinates v1, PVCoordinates 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 theRotation
class. As far as the Rotation constructor is concerned, thev₂
vector from the second pair can be slightly misaligned. The Rotation 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
-
AngularCoordinates
public AngularCoordinates(PVCoordinates u, PVCoordinates v)
Build one of the rotations that transform one pv coordinates into another one.Except for a possible scale factor, if the instance were applied to the vector u it will produce the vector v. There is an infinite number of such rotations, this constructor choose the one with the smallest associated angle (i.e. the one whose axis is orthogonal to the (u, v) plane). If u and v are collinear, an arbitrary rotation axis is chosen.
- Parameters:
u
- origin vectorv
- desired image of u by the rotation
-
AngularCoordinates
public AngularCoordinates(org.hipparchus.geometry.euclidean.threed.FieldRotation<org.hipparchus.analysis.differentiation.DerivativeStructure> r)
Builds a AngularCoordinates from aFieldRotation
<DerivativeStructure
>.The rotation components must have time as their only derivation parameter and have consistent derivation orders.
- Parameters:
r
- rotation with time-derivatives embedded within the coordinates
-
-
Method Detail
-
toDerivativeStructureRotation
public org.hipparchus.geometry.euclidean.threed.FieldRotation<org.hipparchus.analysis.differentiation.DerivativeStructure> toDerivativeStructureRotation(int order)
Transform the instance to aFieldRotation
<DerivativeStructure
>.The
DerivativeStructure
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
-
estimateRate
public static org.hipparchus.geometry.euclidean.threed.Vector3D estimateRate(org.hipparchus.geometry.euclidean.threed.Rotation start, org.hipparchus.geometry.euclidean.threed.Rotation 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.
- 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 AngularCoordinates 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
-
shiftedBy
public AngularCoordinates shiftedBy(double dt)
Get a time-shifted state.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.
- Specified by:
shiftedBy
in interfaceTimeShiftable<AngularCoordinates>
- Parameters:
dt
- time shift in seconds- Returns:
- a new state, shifted with respect to the instance (which is immutable)
-
getRotation
public org.hipparchus.geometry.euclidean.threed.Rotation getRotation()
Get the rotation.- Returns:
- the rotation.
-
getRotationRate
public org.hipparchus.geometry.euclidean.threed.Vector3D getRotationRate()
Get the rotation rate.- Returns:
- the rotation rate vector Ω (rad/s).
-
getRotationAcceleration
public org.hipparchus.geometry.euclidean.threed.Vector3D getRotationAcceleration()
Get the rotation acceleration.- Returns:
- the rotation acceleration vector dΩ/dt (rad²/s²).
-
addOffset
public AngularCoordinates addOffset(AngularCoordinates 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(AngularCoordinates)
-
subtractOffset
public AngularCoordinates subtractOffset(AngularCoordinates 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(AngularCoordinates)
-
applyTo
public PVCoordinates 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 u by the rotation
-
applyTo
public TimeStampedPVCoordinates 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 u by the rotation
-
applyTo
public <T extends org.hipparchus.RealFieldElement<T>> FieldPVCoordinates<T> applyTo(FieldPVCoordinates<T> pv)
Apply the rotation to a pv coordinates.- Type Parameters:
T
- type of the field elements- Parameters:
pv
- vector to apply the rotation to- Returns:
- a new pv coordinates which is the image of u by the rotation
- Since:
- 9.0
-
applyTo
public <T extends org.hipparchus.RealFieldElement<T>> TimeStampedFieldPVCoordinates<T> applyTo(TimeStampedFieldPVCoordinates<T> pv)
Apply the rotation to a pv coordinates.- Type Parameters:
T
- type of the field elements- Parameters:
pv
- vector to apply the rotation to- Returns:
- a new pv coordinates which is the image of u by the rotation
- Since:
- 9.0
-
getModifiedRodrigues
public double[][] 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)
- See Also:
createFromModifiedRodrigues(double[][])
-
createFromModifiedRodrigues
public static AngularCoordinates createFromModifiedRodrigues(double[][] r)
Convert a modified Rodrigues vector and derivatives to angular coordinates.- Parameters:
r
- modified Rodrigues vector (with first and second times derivatives)- Returns:
- angular coordinates
- See Also:
getModifiedRodrigues(double)
-
-