public final class AxisAngleSequence extends Object
Class representing a sequence of axis-angle rotations. These types of rotations are commonly called Euler angles, Tait-Bryan angles, or Cardan angles depending on the properties of the rotation sequence and the particular use case. A sequence of three rotations around at least two different axes is sufficient to represent any rotation or orientation in 3 dimensional space. However, in order to unambiguously represent the rotation, the following information must be provided along with the rotation angles:
Computations involving multiple rotations are generally very complicated when using axis-angle sequences. Therefore, it is recommended
to only use this class to represent angles and orientations when needed in this form, and to use QuaternionRotation
for everything else. Quaternions are much easier to work with and avoid many of the problems of axis-angle sequence representations,
such as gimbal lock.
QuaternionRotation
Constructor and Description |
---|
AxisAngleSequence(AxisReferenceFrame referenceFrame,
AxisSequence axisSequence,
double angle1,
double angle2,
double angle3)
Construct an instance from its component parts.
|
Modifier and Type | Method and Description |
---|---|
static AxisAngleSequence |
createAbsolute(AxisSequence axisSequence,
double angle1,
double angle2,
double angle3)
Create a new instance with a reference frame of
AxisReferenceFrame.ABSOLUTE . |
static AxisAngleSequence |
createRelative(AxisSequence axisSequence,
double angle1,
double angle2,
double angle3)
Create a new instance with a reference frame of
AxisReferenceFrame.RELATIVE . |
boolean |
equals(Object obj) |
double |
getAngle1()
Get the angle of rotation around the first axis, in radians.
|
double |
getAngle2()
Get the angle of rotation around the second axis, in radians.
|
double |
getAngle3()
Get the angle of rotation around the third axis, in radians.
|
double[] |
getAngles()
Get the rotation angles as a 3-element array.
|
AxisSequence |
getAxisSequence()
Get the rotation axis sequence.
|
AxisReferenceFrame |
getReferenceFrame()
Get the axis reference frame.
|
int |
hashCode() |
String |
toString() |
public AxisAngleSequence(AxisReferenceFrame referenceFrame, AxisSequence axisSequence, double angle1, double angle2, double angle3)
referenceFrame
- the axis reference frameaxisSequence
- the axis rotation sequenceangle1
- angle around the first axis in radiansangle2
- angle around the second axis in radiansangle3
- angle around the third axis in radianspublic AxisReferenceFrame getReferenceFrame()
public AxisSequence getAxisSequence()
public double getAngle1()
public double getAngle2()
public double getAngle3()
public double[] getAngles()
public static AxisAngleSequence createRelative(AxisSequence axisSequence, double angle1, double angle2, double angle3)
AxisReferenceFrame.RELATIVE
.axisSequence
- the axis rotation sequenceangle1
- angle around the first axis in radiansangle2
- angle around the second axis in radiansangle3
- angle around the third axis in radianspublic static AxisAngleSequence createAbsolute(AxisSequence axisSequence, double angle1, double angle2, double angle3)
AxisReferenceFrame.ABSOLUTE
.axisSequence
- the axis rotation sequenceangle1
- angle around the first axis in radiansangle2
- angle around the second axis in radiansangle3
- angle around the third axis in radiansCopyright © 2016–2021 The Apache Software Foundation. All rights reserved.