public final class EulerAngles extends AbstractRotation<EulerAngles> implements javolution.xml.XMLSerializable
Reference: Shoemake, Ken (1994), "Euler angle conversion", in Paul Heckbert, Graphics Gems IV, San Diego: Academic Press Professional, pp. 222-229, ISBN 978-0-12-336155-4.
Modified by: Joseph A. Huwaldt
Modifier and Type | Class and Description |
---|---|
static class |
EulerAngles.Axis
Enumeration of the axes that a rotation may be made around.
|
static class |
EulerAngles.Frame
Enumeration of the frame from which the axes are taken.
|
static class |
EulerAngles.Order
Enumeration of all the combinations of the Euler angle orders for both static ("s")
and rotating ("r") axes.
|
static class |
EulerAngles.Parity
Enumeration of the parity of the axis permutation.
|
Modifier and Type | Field and Description |
---|---|
static boolean |
NO
Indicates that the initial axis is NOT repeated as the last axis.
|
static EulerAngles.Order |
YAW_PITCH_ROLL
The Euler order typically used in aerospace applications.
|
static boolean |
YES
Indicates repetition of initial axis as the last.
|
Modifier and Type | Method and Description |
---|---|
EulerAngles |
copy()
Returns a copy of this set of Euler angles
allocated by the calling thread
(possibly on the stack). |
EulerAngles |
divide(double divisor)
Returns this set of Euler angles with each angle divided by the specified divisor.
|
boolean |
equals(java.lang.Object that)
Compares this EulerAngles against the specified object for strict equality (same
rotation type and same values).
|
Parameter<Angle> |
get(int i)
Returns the value of an element from this set of Euler angles (0=1st axis, 1=2nd
axis, 2=3rd axis).
|
EulerAngles.Order |
getEulerOrder()
Returns the Euler order for this set of Euler angles.
|
Unit<Angle> |
getUnit()
Returns the unit in which the
values in this set of Euler angles
are stated in. |
double |
getValue(int i)
Returns the value of a floating point number from this set of Euler angles (0=1st
axis, 1=2nd axis, 2=3rd axis).
|
int |
hashCode()
Returns the hash code for this rotation.
|
static void |
main(java.lang.String[] args)
Tests the methods in this class.
|
EulerAngles |
minus(EulerAngles that)
Returns the difference between this set of Euler angles and the one specified.
|
EulerAngles |
minus(Parameter<Angle> that)
Subtracts the supplied angle from each element of this set of Euler angles and
returns the result.
|
EulerAngles |
minus(Vector<Parameter<Angle>> that)
Returns the difference between this set of Euler angles and the one specified.
|
EulerAngles |
opposite()
Returns the negation of this set of Euler angles (each angle is negated).
|
EulerAngles |
plus(EulerAngles that)
Returns the sum of this set of Euler angles with the one specified.
|
EulerAngles |
plus(Parameter<Angle> that)
Returns the sum of this set of Euler angles with the angle specified.
|
EulerAngles |
plus(Vector<Parameter<Angle>> that)
Returns the sum of this set of Euler angles with the one specified.
|
EulerAngles |
times(double k)
Returns the product of this set of Euler angles with the specified coefficient.
|
EulerAngles |
times(Rotation<?> that)
Returns the product of this set of Euler angles and the specified rotation
transform.
|
EulerAngles |
to(Unit<Angle> unit)
Returns the equivalent to this set of Euler angles but stated in the specified
angle unit.
|
DCMatrix |
toDCM()
Returns a direction cosine transformation matrix from this set of Euler angles.
|
Float64Vector |
toFloat64Vector()
Returns the values stored in this set of Euler angles, in the current units, as a
Float64Vector with the values ordered (1st axis angle, 2nd axis angle, 3rd axis
angle).
|
Quaternion |
toQuaternion()
Returns a quaternion from this set of Euler angles.
|
javolution.text.Text |
toText()
Returns the text representation of this set of Euler angles.
|
<Q extends Quantity> |
transform(Coordinate3D<Q> v)
Transforms a 3D vector from frame A to B using this set of Euler angles.
|
EulerAngles |
transpose()
Returns the spatial inverse of this transformation: AB rather than BA.
|
static EulerAngles |
valueOf(Parameter<Angle> theta1,
Parameter<Angle> theta2,
Parameter<Angle> theta3,
EulerAngles.Order eulerOrder)
Returns an
EulerAngles instance holding the specified
Parameter<Angle> values for the rotation angle elements and the
specified Euler order information. |
static EulerAngles |
valueOf(Rotation<?> transform,
EulerAngles.Order order)
Returns an
EulerAngles object constructed from the specified rotation
transformation. |
static EulerAngles |
valueOf(Vector3D<Angle> theta,
EulerAngles.Axis initialAxis,
EulerAngles.Parity parity,
boolean repeat1st,
EulerAngles.Frame frame)
Returns an
EulerAngles instance holding the specified
Vector3D<Angle> values for the rotation angle elements and the
specified Euler order information. |
static EulerAngles |
valueOf(Vector3D<Angle> theta,
EulerAngles.Order eulerOrder)
Returns an
EulerAngles instance holding the specified
Vector3D<Angle> values for the rotation angle elements and the
specified Euler order information. |
getEulerTM, getPsiThetaTM, getPsiThetaTM, isApproxEqual, toString
public static final boolean NO
public static final boolean YES
public static final EulerAngles.Order YAW_PITCH_ROLL
public static EulerAngles valueOf(Vector3D<Angle> theta, EulerAngles.Axis initialAxis, EulerAngles.Parity parity, boolean repeat1st, EulerAngles.Frame frame)
EulerAngles
instance holding the specified
Vector3D<Angle>
values for the rotation angle elements and the
specified Euler order information.theta
- The rotation angles about each axis (0=1st axis, 1=2nd axis,
2=3rd axis).initialAxis
- The initial rotation axis (X, Y, or Z).parity
- The parity of the axis permutation (EVEN or ODD).repeat1st
- Repeat the initial axis as the last if true, do not repeat if
false.frame
- The frame from which the axes are taken (STATIC or ROTATING).public static EulerAngles valueOf(Vector3D<Angle> theta, EulerAngles.Order eulerOrder)
EulerAngles
instance holding the specified
Vector3D<Angle>
values for the rotation angle elements and the
specified Euler order information.theta
- The rotation angles about each axis (0=1st axis, 1=2nd axis,
2=3rd axis).eulerOrder
- The Euler order to use (one of the enumerations in this class).public static EulerAngles valueOf(Parameter<Angle> theta1, Parameter<Angle> theta2, Parameter<Angle> theta3, EulerAngles.Order eulerOrder)
EulerAngles
instance holding the specified
Parameter<Angle>
values for the rotation angle elements and the
specified Euler order information.theta1
- The rotation angle about the 1st axis.theta2
- The rotation angle about the 2nd axis.theta3
- The rotation angle about the 3rd axis.eulerOrder
- The Euler order to use (one of the enumerations in this class).public static EulerAngles valueOf(Rotation<?> transform, EulerAngles.Order order)
EulerAngles
object constructed from the specified rotation
transformation.transform
- The rotation transform representing a rotation from frame A to
frame B.order
- The Euler order to use (one of the enumerations in this class).public Parameter<Angle> get(int i)
i
- the dimension index (0=1st axis, 1=2nd axis, 2=3rd axis).i
.java.lang.IndexOutOfBoundsException
- (i < 0) || (i > dimension()-1)
public double getValue(int i)
i
- the floating point number index (0=1st axis, 1=2nd axis, 2=3rd axis).i
.java.lang.IndexOutOfBoundsException
- (i < 0) || (i > dimension()-1)
public EulerAngles.Order getEulerOrder()
public EulerAngles opposite()
-this
.public EulerAngles plus(EulerAngles that)
that
- the Euler angles to be added.this + that
.public EulerAngles plus(Vector<Parameter<Angle>> that)
that
- the set of Euler angles of angles to be added.this + that
.DimensionException
- if vector dimensions are different.ConversionException
- if the current model does not allow for conversion the
units of the input vector to an Angle unit.public EulerAngles plus(Parameter<Angle> that)
that
- the angle to be added to each element of this set of Euler angles.this + that
.public EulerAngles minus(EulerAngles that)
that
- the Euler angles to be subtracted.this - that
.public EulerAngles minus(Vector<Parameter<Angle>> that)
that
- the vector of angles to be subtracted.this - that
.DimensionException
- if vector dimensions are different.ConversionException
- if the current model does not allow for conversion the
units of the input vector to an Angle unit.public EulerAngles minus(Parameter<Angle> that)
that
- the angle to be subtracted from each element of this set of Euler
angles.this - that
.public EulerAngles times(double k)
k
- the coefficient multiplier.this · k
public EulerAngles divide(double divisor)
divisor
- the divisor.this / divisor
.public <Q extends Quantity> Vector3D<Q> transform(Coordinate3D<Q> v)
transform
in interface Rotation<EulerAngles>
Q
- The Quantity (unit type) of the input and output vectors.v
- the vector expressed in frame A.public EulerAngles transpose()
transpose
in interface Rotation<EulerAngles>
this'
public EulerAngles times(Rotation<?> that)
times
in interface Rotation<EulerAngles>
that
- the rotation transform multiplier.this · that
public Unit<Angle> getUnit()
values
in this set of Euler angles
are stated in.public EulerAngles to(Unit<Angle> unit)
unit
- the angle unit of the Euler angles to be returned.ConversionException
- if the current model does not allows for conversion to
the specified unit.public Float64Vector toFloat64Vector()
public DCMatrix toDCM()
toDCM
in interface Rotation<EulerAngles>
public Quaternion toQuaternion()
toQuaternion
in interface Rotation<EulerAngles>
public EulerAngles copy()
allocated
by the calling thread
(possibly on the stack).copy
in interface Rotation<EulerAngles>
copy
in interface javolution.lang.ValueType
public javolution.text.Text toText()
toText
in interface javolution.lang.Realtime
public boolean equals(java.lang.Object that)
equals
in class java.lang.Object
that
- the object to compare with.true
if this rotation is identical to that rotation;
false
otherwise.public int hashCode()
hashCode
in class java.lang.Object
public static void main(java.lang.String[] args)
args
- Command line arguments (ignored)