AxisAngleBasics
, AxisAngleReadOnly
, Clearable
, EpsilonComparable<AxisAngle32>
, GeometricallyComparable<AxisAngle32>
, Settable<AxisAngle32>
, Orientation3DBasics
, Orientation3DReadOnly
public class AxisAngle32 extends java.lang.Object implements AxisAngleBasics, Settable<AxisAngle32>, EpsilonComparable<AxisAngle32>, GeometricallyComparable<AxisAngle32>
AxisAngle
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. This version of axis-angle uses single
precision fields to save the value of each component. It is meant for garbage free usage and for
situations where heap memory is limited. When memory is not a constraint, the use of
AxisAngle
is preferable.ORIENTATION_2D_EPSILON
Constructor | Description |
---|---|
AxisAngle32() |
Creates an axis-angle that represents a "zero" rotation.
|
AxisAngle32(double yaw,
double pitch,
double roll) |
Creates an axis-angle such that it represents the same orientation the yaw-pitch-roll angles
represents.
|
AxisAngle32(float[] axisAngleArray) |
Creates an axis-angle initialized with the values contained in the given array:
this.setX(axisAngleArray[0]);
this.setY(axisAngleArray[1]);
this.setZ(axisAngleArray[2]);
this.setAngle(axisAngleArray[3]);
|
AxisAngle32(float x,
float y,
float z,
float angle) |
Creates an axis-angle with the given values of the axis (
x , y , z ) and
of the angle angle . |
AxisAngle32(Orientation3DReadOnly orientation) |
Creates an axis-angle that represents the same orientation as the given one.
|
AxisAngle32(Vector3DReadOnly rotationVector) |
Creates an axis-angle such that it represents the same orientation the rotation vector
represents.
|
AxisAngle32(Vector3DReadOnly axis,
float angle) |
Create an axis-angle from the given axis and angle.
|
Modifier and Type | Method | Description |
---|---|---|
boolean |
epsilonEquals(AxisAngle32 other,
double epsilon) |
Tests on a per component basis, if this axis-angle is equal to
other to an
epsilon . |
boolean |
equals(java.lang.Object object) |
Tests if the given
object 's class is the same as this, in which case the method
returns AxisAngleReadOnly.equals(AxisAngleReadOnly) , it returns false otherwise. |
boolean |
geometricallyEquals(AxisAngle32 other,
double epsilon) |
Tests if
this and other represent the same orientation to an epsilon . |
double |
getAngle() |
Returns the angle of this axis-angle, usually expressed in radians.
|
float |
getAngle32() |
Returns the angle of this axis-angle, usually expressed in radians.
|
double |
getX() |
Returns the x-component of the unitary axis of this axis-angle.
|
float |
getX32() |
Returns the x-component of the unitary axis of this axis-angle.
|
double |
getY() |
Returns the y-component of the unitary axis of this axis-angle.
|
float |
getY32() |
Returns the y-component of the unitary axis of this axis-angle.
|
double |
getZ() |
Returns the z-component of the unitary axis of this axis-angle.
|
float |
getZ32() |
Returns the z-component of the unitary axis of this axis-angle.
|
int |
hashCode() |
Calculates and returns a hash code value from the value of each component of this axis-angle.
|
void |
set(float x,
float y,
float z,
float angle) |
Sets this axis-angle to represent a new rotation of axis (
x , y , z ) and
angle of angle . |
void |
set(AxisAngle32 other) |
Sets this axis-angle to the same value as the given axis-angle
other . |
void |
setAngle(double angle) |
Sets a new angle to this axis-angle.
|
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.
|
void |
setZ(double z) |
Sets a new z-component for the axis of this axis-angle.
|
java.lang.String |
toString() |
Provides a
String representation of this axis-angle as follows: (x, y, z, angle). |
absolute, append, appendInvertOther, appendPitchRotation, appendRollRotation, appendYawRotation, containsNaN, inverse, invert, multiply, multiply, multiplyInvertBoth, multiplyInvertOther, multiplyInvertThis, negate, normalize, normalizeAxis, preMultiply, preMultiplyInvertBoth, preMultiplyInvertOther, preMultiplyInvertThis, prepend, prependInvertOther, prependPitchRotation, prependRollRotation, prependYawRotation, scaleAngle, set, set, set, set, set, set, set, set, setAndNegate, setAxisAngle, setElement, setQuaternion, setRotationMatrix, setRotationVector, setToNaN, setToZero, setYawPitchRoll
addTransform, axisNorm, checkIfIsZOnly, distance, epsilonEquals, equals, geometricallyEquals, get, get, get, get, get, get, get, getElement, getElement32, getEuler, getPitch, getRoll, getRotationVector, getYaw, getYawPitchRoll, inverseTransform, inverseTransform, inverseTransform, inverseTransform, isAxisUnitary, isOrientation2D, isZOnly, transform, transform, transform, transform
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
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
public AxisAngle32()
public AxisAngle32(Orientation3DReadOnly orientation)
orientation
- the orientation to initialize this axis-angle. Not modified.public AxisAngle32(float x, float y, float z, float angle)
x
, y
, z
) and
of the angle angle
.x
- x-component of the axis.y
- y-component of the axis.z
- z-component of the axis.angle
- the angle value.public AxisAngle32(float[] axisAngleArray)
this.setX(axisAngleArray[0]);
this.setY(axisAngleArray[1]);
this.setZ(axisAngleArray[2]);
this.setAngle(axisAngleArray[3]);
axisAngleArray
- the array containing the values for this axis-angle. Not modified.public AxisAngle32(Vector3DReadOnly axis, float angle)
axis
- the axis. Not modifiedangle
- the angle value.public AxisAngle32(Vector3DReadOnly rotationVector)
AxisAngleConversion.convertRotationVectorToAxisAngle(Vector3DReadOnly, AxisAngleBasics)
.rotationVector
- the rotation vector used to create this axis-angle. Not modified.public AxisAngle32(double yaw, double pitch, double roll)
AxisAngleConversion.convertYawPitchRollToAxisAngle(double, double, double, AxisAngleBasics)
.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.public void set(AxisAngle32 other)
other
.set
in interface Settable<AxisAngle32>
other
- the other axis-angle. Not modified.public final void set(float x, float y, float z, float 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.public final void setX(double x)
setX
in interface AxisAngleBasics
x
- the new axis x-component.public final void setY(double y)
setY
in interface AxisAngleBasics
y
- the new axis y-component.public final void setZ(double z)
setZ
in interface AxisAngleBasics
z
- the new axis z-component.public final void setAngle(double angle)
setAngle
in interface AxisAngleBasics
angle
- the new angle.public double getX()
getX
in interface AxisAngleReadOnly
public double getY()
getY
in interface AxisAngleReadOnly
public double getZ()
getZ
in interface AxisAngleReadOnly
public final double getAngle()
getAngle
in interface AxisAngleReadOnly
public final float getAngle32()
getAngle32
in interface AxisAngleReadOnly
public final float getX32()
getX32
in interface AxisAngleReadOnly
public final float getY32()
getY32
in interface AxisAngleReadOnly
public final float getZ32()
getZ32
in interface AxisAngleReadOnly
public boolean equals(java.lang.Object object)
object
's class is the same as this, in which case the method
returns AxisAngleReadOnly.equals(AxisAngleReadOnly)
, it returns false
otherwise.equals
in class java.lang.Object
object
- the object to compare against this. Not modified.true
if object
and this are exactly equal, false
otherwise.public boolean epsilonEquals(AxisAngle32 other, double epsilon)
other
to an
epsilon
. A failing test does not necessarily mean that the two axis-angles represent
two different orientations.epsilonEquals
in interface EpsilonComparable<AxisAngle32>
other
- the other axis-angle to compare against this. Not modified.epsilon
- tolerance to use when comparing each component.true
if the two axis-angle are equal component-wise, false
otherwise.public boolean geometricallyEquals(AxisAngle32 other, double epsilon)
this
and other
represent the same orientation to an epsilon
.
Two axis-angle are considered geometrically equal if the magnitude of their difference is less
than or equal to epsilon
.
Note that this.geometricallyEquals(other, epsilon) == true
does not necessarily imply
this.epsilonEquals(other, epsilon)
and vice versa.
geometricallyEquals
in interface GeometricallyComparable<AxisAngle32>
other
- the other axis-angle to compare against this. Not modified.epsilon
- the maximum angle for the two quaternions to be considered equal.true
if the two axis-angle represent the same geometry, false
otherwise.public java.lang.String toString()
String
representation of this axis-angle as follows: (x, y, z, angle).toString
in class java.lang.Object
String
representing this axis-angle.public int hashCode()
hashCode
in class java.lang.Object