AxisAngleReadOnly
, Clearable
, Orientation3DBasics
, Orientation3DReadOnly
AxisAngle
, AxisAngle32
public interface AxisAngleBasics extends AxisAngleReadOnly, Orientation3DBasics, Clearable
An axis-angle is used to represent a 3D orientation by a unitary axis of components (x, y, z) and an angle of rotation usually expressed in radians.
ORIENTATION_2D_EPSILON
Modifier and Type | Method | Description |
---|---|---|
default void |
absolute() |
Sets each component of this axis-angle to its absolute value.
|
default void |
append(Orientation3DReadOnly other) |
Appends the given orientation to this orientation.
|
default void |
appendInvertOther(Orientation3DReadOnly orientation) |
Appends the inverse of the given orientation to this orientation.
|
default void |
appendPitchRotation(double pitch) |
Append a rotation about the y-axis to this axis-angle.
|
default void |
appendRollRotation(double roll) |
Append a rotation about the x-axis to this axis-angle.
|
default void |
appendYawRotation(double yaw) |
Append a rotation about the z-axis to this axis-angle.
|
default boolean |
containsNaN() |
Tests if this axis-angle contains a
Double.NaN . |
default void |
inverse() |
Deprecated.
Use
invert() instead. |
default void |
invert() |
Inverses this orientation.
|
default void |
multiply(AxisAngleReadOnly other) |
Multiplies this axis-angle by
other . |
default void |
multiply(AxisAngleReadOnly aa1,
AxisAngleReadOnly aa2) |
Sets this axis-angle to the multiplication of
aa1 and aa2 . |
default void |
multiplyInvertBoth(AxisAngleReadOnly other) |
Sets this axis-angle to the multiplication of the inverse of
this and the inverse of
other . |
default void |
multiplyInvertOther(AxisAngleReadOnly other) |
Multiplies this axis-angle by the inverse of
other . |
default void |
multiplyInvertThis(AxisAngleReadOnly other) |
Sets this axis-angle to the multiplication of the inverse of
this and other . |
default void |
negate() |
Negates each component of this axis-angle.
|
default void |
normalize() |
Normalizes the axis of this axis-angle such that its norm is equal to 1 after calling this
method and its direction remains unchanged.
|
default void |
normalizeAxis() |
Deprecated.
Use
normalize() instead |
default void |
preMultiply(AxisAngleReadOnly other) |
Pre-multiplies this axis-angle by
other . |
default void |
preMultiplyInvertBoth(AxisAngleReadOnly other) |
Sets this axis-angle to the multiplication of the inverse of
other and the inverse of
this . |
default void |
preMultiplyInvertOther(AxisAngleReadOnly other) |
Sets this axis-angle to the multiplication of the inverse of
other and this . |
default void |
preMultiplyInvertThis(AxisAngleReadOnly other) |
Sets this axis-angle to the multiplication of
other and the inverse of this . |
default void |
prepend(Orientation3DReadOnly orientation) |
Prepends the given orientation to this orientation.
|
default void |
prependInvertOther(Orientation3DReadOnly orientation) |
Prepends the inverse of the given orientation to this orientation.
|
default void |
prependPitchRotation(double pitch) |
Prepend a rotation about the y-axis to this axis-angle.
|
default void |
prependRollRotation(double roll) |
Prepend a rotation about the x-axis to this axis-angle.
|
default void |
prependYawRotation(double yaw) |
Prepend a rotation about the z-axis to this axis-angle.
|
default void |
scaleAngle(double scale) |
Multiplies the angle of this axis-angle by the given
scale . |
default void |
set(double[] axisAngleArray) |
Copies the values in the given array into this axis-angle as follows:
this.setX(axisAngleArray[0]);
this.setY(axisAngleArray[1]);
this.setZ(axisAngleArray[2]);
this.setAngle(axisAngleArray[3]);
|
default void |
set(double x,
double y,
double z,
double angle) |
Sets this axis-angle to represent a new rotation of axis (
x , y , z ) and
angle of angle . |
default void |
set(float[] axisAngleArray) |
Copies the values in the given array into this axis-angle as follows:
this.setX(axisAngleArray[0]);
this.setY(axisAngleArray[1]);
this.setZ(axisAngleArray[2]);
this.setAngle(axisAngleArray[3]);
|
default void |
set(int startIndex,
double[] axisAngleArray) |
Copies the values in the given array into this axis-angle as follows:
this.setX(axisAngleArray[startIndex + 0]);
this.setY(axisAngleArray[startIndex + 1]);
this.setZ(axisAngleArray[startIndex + 2]);
this.setAngle(axisAngleArray[startIndex + 3]);
|
default void |
set(int startIndex,
float[] axisAngleArray) |
Copies the values in the given array into this axis-angle as follows:
this.setX(axisAngleArray[startIndex + 0]);
this.setY(axisAngleArray[startIndex + 1]);
this.setZ(axisAngleArray[startIndex + 2]);
this.setAngle(axisAngleArray[startIndex + 3]);
|
default void |
set(AxisAngleReadOnly other) |
Sets this axis-angle to the same value as the given axis-angle
other . |
default void |
set(Orientation3DReadOnly orientation3DReadOnly) |
Converts, if necessary, and sets this orientation to represents the same orientation as
orientation3DReadOnly . |
default void |
set(Vector3DReadOnly axis,
double angle) |
Sets the axis and the angle of this axis-angle.
|
default void |
setAndNegate(AxisAngleReadOnly other) |
Sets this axis-angle to
other and then calls negate() . |
void |
setAngle(double angle) |
Sets a new angle to this axis-angle.
|
default void |
setAxisAngle(double x,
double y,
double z,
double angle) |
Sets this orientation to represents the same orientation as an axis-angle given its 4
components.
|
default void |
setElement(int index,
double value) |
Selects a component of this axis-angle based on
index and sets it to value . |
default void |
setQuaternion(double x,
double y,
double z,
double s) |
Sets this orientation to represents the same orientation as a quaternion given its 4
components.
|
default void |
setRotationMatrix(double m00,
double m01,
double m02,
double m10,
double m11,
double m12,
double m20,
double m21,
double m22) |
Sets this orientation to represents the same orientation as a rotation matrix given its 9
components.
|
default void |
setRotationVector(double x,
double y,
double z) |
Sets this orientation to represents the same orientation as a rotation vector given its 3
components.
|
default void |
setToNaN() |
Sets the components of this axis-angle to
Double.NaN . |
default void |
setToZero() |
Sets the components of this axis-angle to represent a "zero" rotation.
|
void |
setX(double x) |
Sets a new x-component for the axis of this axis-angle.
|
void |
setY(double y) |
Sets a new y-component for the axis of this axis-angle.
|
default void |
setYawPitchRoll(double yaw,
double pitch,
double roll) |
Sets this orientation to represents the same orientation as a yaw-pitch-roll representation.
|
void |
setZ(double z) |
Sets a new z-component for the axis of this axis-angle.
|
addTransform, axisNorm, checkIfIsZOnly, distance, epsilonEquals, equals, geometricallyEquals, get, get, get, get, get, get, get, getAngle, getAngle32, getElement, getElement32, getEuler, getPitch, getRoll, getRotationVector, getX, getX32, getY, getY32, getYaw, getYawPitchRoll, getZ, getZ32, inverseTransform, inverseTransform, inverseTransform, inverseTransform, isAxisUnitary, isOrientation2D, isZOnly, transform, transform, transform, transform
appendInvertBoth, appendInvertThis, prependInvertBoth, prependInvertThis, setAndInvert, setAndNormalize, setEuler, setEuler, setRotationVector, setYawPitchRoll
addTransform, checkIfOrientation2D, checkIfOrientation2D, inverseTransform, inverseTransform, inverseTransform, inverseTransform, inverseTransform, inverseTransform, inverseTransform, inverseTransform, inverseTransform, inverseTransform, inverseTransform, inverseTransform, isOrientation2D, toStringAsYawPitchRoll, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform
void setAngle(double angle)
angle
- the new angle.void setX(double x)
x
- the new axis x-component.void setY(double y)
y
- the new axis y-component.void setZ(double z)
z
- the new axis z-component.default void setToZero()
default void setToNaN()
Double.NaN
.default boolean containsNaN()
Double.NaN
.containsNaN
in interface AxisAngleReadOnly
containsNaN
in interface Clearable
true
if this axis-angle contains a Double.NaN
, false
otherwise.default void absolute()
default void negate()
@Deprecated default void inverse()
invert()
instead.default void invert()
If this orientation describes the orientation of a coordinate system A with respect to a coordinate system B, after this method, the orientation will describe the orientation of B with respect to A.
Note that appending or prepending an orientation with its inverse will result into a "zero" orientation.
invert
in interface Orientation3DBasics
@Deprecated default void normalizeAxis()
normalize()
insteadEdge cases:
Double.NaN
, this method is ineffective.
default void normalize()
Edge cases:
Double.NaN
, this method is ineffective.
normalize
in interface Orientation3DBasics
default void scaleAngle(double scale)
scale
.scale
- the scaling factor to apply to the angle of this axis-angle.default void set(double x, double y, double z, double angle)
x
, y
, z
) and
angle of angle
.x
- x-component of the new axis.y
- y-component of the new axis.z
- z-component of the new axis.angle
- the new angle.default void set(Orientation3DReadOnly orientation3DReadOnly)
orientation3DReadOnly
.set
in interface Orientation3DBasics
orientation3DReadOnly
- the new orientation. Not modified.default void set(Vector3DReadOnly axis, double angle)
axis
- the new axis. Not modified.angle
- the new angle.default void set(AxisAngleReadOnly other)
other
.other
- the other axis-angle. Not modified.default void setAndNegate(AxisAngleReadOnly other)
other
and then calls negate()
.other
- the other axis-angle to copy the values from. Not modified.default void set(double[] axisAngleArray)
this.setX(axisAngleArray[0]);
this.setY(axisAngleArray[1]);
this.setZ(axisAngleArray[2]);
this.setAngle(axisAngleArray[3]);
axisAngleArray
- the array containing the new values for this axis-angle. Not modified.default void set(int startIndex, double[] axisAngleArray)
this.setX(axisAngleArray[startIndex + 0]);
this.setY(axisAngleArray[startIndex + 1]);
this.setZ(axisAngleArray[startIndex + 2]);
this.setAngle(axisAngleArray[startIndex + 3]);
startIndex
- the first index to start reading from in the array.axisAngleArray
- the array containing the new values for this axis-angle. Not modified.default void set(float[] axisAngleArray)
this.setX(axisAngleArray[0]);
this.setY(axisAngleArray[1]);
this.setZ(axisAngleArray[2]);
this.setAngle(axisAngleArray[3]);
axisAngleArray
- the array containing the new values for this axis-angle. Not modified.default void set(int startIndex, float[] axisAngleArray)
this.setX(axisAngleArray[startIndex + 0]);
this.setY(axisAngleArray[startIndex + 1]);
this.setZ(axisAngleArray[startIndex + 2]);
this.setAngle(axisAngleArray[startIndex + 3]);
startIndex
- the first index to start reading from in the array.axisAngleArray
- the array containing the new values for this axis-angle. Not modified.default void setAxisAngle(double x, double y, double z, double angle)
setAxisAngle
in interface Orientation3DBasics
x
- x-component of the axis part of the axis-angle.y
- y-component of the axis part of the axis-angle.z
- z-component of the axis part of the axis-angle.angle
- the angle part of the axis-angle.default void setQuaternion(double x, double y, double z, double s)
setQuaternion
in interface Orientation3DBasics
x
- the x-component of the quaternion.y
- the y-component of the quaternion.z
- the z-component of the quaternion.s
- the s-component of the quaternion.default void setRotationVector(double x, double y, double z)
WARNING: a rotation vector is different from a yaw-pitch-roll or Euler angles representation. A rotation vector is equivalent to the axis of an axis-angle that is multiplied by the angle of the same axis-angle.
setRotationVector
in interface Orientation3DBasics
x
- the x-component of the rotation vector.y
- the y-component of the rotation vector.z
- the z-component of the rotation vector.default void setYawPitchRoll(double yaw, double pitch, double roll)
WARNING: the Euler angles or yaw-pitch-roll representation is sensitive to gimbal lock and is sometimes undefined.
The yaw-pitch-roll representation describes a 3D orientation as a succession of three rotations around three axes:
As an example, a rotation matrix can be computed from a yaw-pitch-roll representation as follows:
/ cos(yaw) -sin(yaw) 0 \ / cos(pitch) 0 sin(pitch) \ / 1 0 0 \ R = | sin(yaw) cos(yaw) 0 | * | 0 1 0 | * | 0 cos(roll) -sin(roll) | \ 0 0 1 / \ -sin(pitch) 0 cos(pitch) / \ 0 sin(roll) cos(roll) /
setYawPitchRoll
in interface Orientation3DBasics
yaw
- the angle to rotate about the z-axis.pitch
- the angle to rotate about the y-axis.roll
- the angle to rotate about the x-axis.default void setRotationMatrix(double m00, double m01, double m02, double m10, double m11, double m12, double m20, double m21, double m22)
setRotationMatrix
in interface Orientation3DBasics
m00
- the new 1st row 1st column coefficient of the rotation matrix.m01
- the new 1st row 2nd column coefficient of the rotation matrix.m02
- the new 1st row 3rd column coefficient of the rotation matrix.m10
- the new 2nd row 1st column coefficient of the rotation matrix.m11
- the new 2nd row 2nd column coefficient of the rotation matrix.m12
- the new 2nd row 3rd column coefficient of the rotation matrix.m20
- the new 3rd row 1st column coefficient of the rotation matrix.m21
- the new 3rd row 2nd column coefficient of the rotation matrix.m22
- the new 3rd row 3rd column coefficient of the rotation matrix.default void setElement(int index, double value)
index
and sets it to value
.
For index
values of 0, 1, and 2, the corresponding components are x, y, and z,
respectively, while 3 corresponds to the angle.
index
- the index of the component to set.value
- the new value of the selected component.java.lang.IndexOutOfBoundsException
- if index
∉ [0, 3].default void multiply(AxisAngleReadOnly other)
other
.
this = this * other
other
- the other axis-angle to multiply this. Not modified.default void append(Orientation3DReadOnly other)
Let's consider the following:
this
represents the orientation of B relative to A.
orientation
represents the orientation of C relative to B.
this
, represents the orientation of
C relative to A.
Appending orientations is in some way similar to summing translations. However, while the
addition for translation is commutative, the "append" operation on orientation is NOT
commutative. Such that: this.append(orientation)
≠
orientation.append(this)
.
append
in interface Orientation3DBasics
other
- the orientation to append to this orientation. Not modified.default void multiply(AxisAngleReadOnly aa1, AxisAngleReadOnly aa2)
aa1
and aa2
.
this = aa1 * aa2
aa1
- the first axis-angle in the multiplication. Not modified.aa2
- the second axis-angle in the multiplication. Not modified.default void multiplyInvertOther(AxisAngleReadOnly other)
other
.
this = this * other-1
other
- the other axis-angle to multiply this. Not modified.default void appendInvertOther(Orientation3DReadOnly orientation)
Let's consider the following:
this
represents the orientation of B relative to A.
orientation
represents the orientation of B relative to C.
this
, represents the orientation of
C relative to A.
This operation is in some way similar to subtracting translations, as in this operation can be
seen as subtracting orientation
to this
.
appendInvertOther
in interface Orientation3DBasics
orientation
- the orientation which the inverse is to be appended to this orientation.
Not modified.default void multiplyInvertThis(AxisAngleReadOnly other)
this
and other
.
this = this-1 * other
other
- the other axis-angle to multiply this. Not modified.default void multiplyInvertBoth(AxisAngleReadOnly other)
this
and the inverse of
other
.
this = this-1 * other-1
other
- the other axis-angle to multiply this. Not modified.default void appendYawRotation(double yaw)
/ ux = 0 \ this = this * | uy = 0 | | uz = 1 | \ angle = yaw /
appendYawRotation
in interface Orientation3DBasics
yaw
- the angle to rotate about the z-axis.default void appendPitchRotation(double pitch)
/ ux = 0 \ this = this * | uy = 1 | | uz = 0 | \ angle = pitch /
appendPitchRotation
in interface Orientation3DBasics
pitch
- the angle to rotate about the y-axis.default void appendRollRotation(double roll)
/ ux = 1 \ this = this * | uy = 0 | | uz = 0 | \ angle = roll /
appendRollRotation
in interface Orientation3DBasics
roll
- the angle to rotate about the x-axis.default void preMultiply(AxisAngleReadOnly other)
other
.
this = other * other
other
- the other axis-angle to multiply this. Not modified.default void prepend(Orientation3DReadOnly orientation)
Let's consider the following:
this
represents the orientation of C relative to B.
orientation
represents the orientation of B relative to A.
this
, represents the orientation of
C relative to A.
Prepending orientations is in some way similar to summing translations. However, while the
addition for translation is commutative, the "prepend" operation on orientation is NOT
commutative. Such that: this.prepend(orientation)
≠
orientation.prepend(this)
.
prepend
in interface Orientation3DBasics
orientation
- the orientation to prepend to this orientation. Not modified.default void preMultiplyInvertOther(AxisAngleReadOnly other)
other
and this
.
this = other-1 * this
other
- the other axis-angle to multiply this. Not modified.default void prependInvertOther(Orientation3DReadOnly orientation)
Let's consider the following:
this
represents the orientation of B relative to C.
orientation
represents the orientation of B relative to A.
this
, represents the orientation of
C relative to A.
This operation is in some way similar to subtracting translations, as in this operation can be
seen as subtracting orientation
to this
.
prependInvertOther
in interface Orientation3DBasics
orientation
- the orientation which the inverse is to be appended to this orientation.
Not modified.default void preMultiplyInvertThis(AxisAngleReadOnly other)
other
and the inverse of this
.
this = other * this-1
other
- the other axis-angle to multiply this. Not modified.default void preMultiplyInvertBoth(AxisAngleReadOnly other)
other
and the inverse of
this
.
this = other-1 * this-1
other
- the other axis-angle to multiply this. Not modified.default void prependYawRotation(double yaw)
/ ux = 0 \ this = | uy = 0 | * this | uz = 1 | \ angle = yaw /
prependYawRotation
in interface Orientation3DBasics
yaw
- the angle to rotate about the z-axis.default void prependPitchRotation(double pitch)
/ ux = 0 \ this = | uy = 1 | * this | uz = 0 | \ angle = pitch /
prependPitchRotation
in interface Orientation3DBasics
pitch
- the angle to rotate about the y-axis.default void prependRollRotation(double roll)
/ ux = 1 \ this = | uy = 0 | * this | uz = 0 | \ angle = roll /
prependRollRotation
in interface Orientation3DBasics
roll
- the angle to rotate about the x-axis.