public final class ElementaryRotation extends Object implements IEquatable<ElementaryRotation>, IEquatableEpsilon<ElementaryRotation>, ImmutableValueType
Cartesian
with this rotation, see Cartesian.rotate(UnitQuaternion)
.
For more information, see the Coordinates topic.
AngleAxisRotation
,
EulerSequence
,
Matrix3By3
,
Quaternion
,
UnitQuaternion
,
YawPitchRoll
Constructor and Description |
---|
ElementaryRotation()
Initializes a new instance.
|
ElementaryRotation(AxisIndicator axis,
double angle)
Initializes an
ElementaryRotation from the provided values. |
Modifier and Type | Method and Description |
---|---|
static boolean |
equals(ElementaryRotation left,
ElementaryRotation right)
Returns
true if the two instances are exactly equal. |
boolean |
equals(Object obj)
Indicates whether another object is exactly equal to this instance.
|
boolean |
equalsEpsilon(ElementaryRotation other,
double epsilon)
Returns true if all of the elements of this rotation are within
epsilon
of the same elements of the specified rotation. |
boolean |
equalsType(ElementaryRotation other)
Indicates whether another instance of this type is exactly equal to this instance.
|
double |
getAngle()
Gets the angle of rotation.
|
AxisIndicator |
getAxis()
Gets the axis of rotation.
|
int |
hashCode()
Returns a hash code for this instance, which is suitable for use in hashing algorithms and data structures like a hash table.
|
ElementaryRotation |
invert()
Inverts this instance, yielding a new
ElementaryRotation . |
ElementaryRotation |
multiply(double scalar)
Multiplies this instance by a scalar, yielding a new
ElementaryRotation . |
static ElementaryRotation |
multiply(double scalar,
ElementaryRotation rotation)
Multiplies a scalar by a specified
ElementaryRotation , yielding a new ElementaryRotation . |
Matrix3By3 |
multiply(ElementaryRotation rotation)
Multiplies this instance by the specified
ElementaryRotation , yielding a Matrix3By3 . |
static ElementaryRotation |
multiply(ElementaryRotation rotation,
double scalar)
Multiplies a specified
ElementaryRotation by a scalar, yielding a new ElementaryRotation . |
static Matrix3By3 |
multiply(ElementaryRotation left,
ElementaryRotation right)
Multiplies a specified
ElementaryRotation by a specified ElementaryRotation , yielding a new Matrix3By3 . |
static Matrix3By3 |
multiply(ElementaryRotation rotation,
Matrix3By3 matrix)
|
static UnitQuaternion |
multiply(ElementaryRotation rotation,
UnitQuaternion quaternion)
|
Matrix3By3 |
multiply(Matrix3By3 matrix)
Multiplies this instance by the specified
Matrix3By3 , yielding a Matrix3By3 . |
UnitQuaternion |
multiply(UnitQuaternion quaternion)
Multiplies this instance by the specified
UnitQuaternion , yielding a UnitQuaternion . |
static boolean |
notEquals(ElementaryRotation left,
ElementaryRotation right)
Returns
true if the two instances are not exactly equal. |
String |
toString()
Returns the value of this set of
ElementaryRotation coordinates in the form "axis, angle" |
public ElementaryRotation()
public ElementaryRotation(@Nonnull AxisIndicator axis, double angle)
ElementaryRotation
from the provided values.axis
- The axis of rotation.angle
- The angle of rotation.@Nonnull public final AxisIndicator getAxis()
public final double getAngle()
@Nonnull public final ElementaryRotation invert()
ElementaryRotation
.ElementaryRotation
.@Nonnull public final ElementaryRotation multiply(double scalar)
ElementaryRotation
.scalar
- The scalar.@Nonnull public final Matrix3By3 multiply(@Nonnull ElementaryRotation rotation)
ElementaryRotation
, yielding a Matrix3By3
.rotation
- The elementary rotation.@Nonnull public final UnitQuaternion multiply(@Nonnull UnitQuaternion quaternion)
UnitQuaternion
, yielding a UnitQuaternion
.quaternion
- The quaternion.UnsupportedCaseException
- Thrown if the Axis
(get
) of this ElementaryRotation
is not
AxisIndicator.FIRST
, AxisIndicator.SECOND
, or AxisIndicator.THIRD
.@Nonnull public final Matrix3By3 multiply(@Nonnull Matrix3By3 matrix)
Matrix3By3
, yielding a Matrix3By3
.matrix
- The matrix.UnsupportedCaseException
- Thrown if the Axis
(get
) of this ElementaryRotation
is not
AxisIndicator.FIRST
, AxisIndicator.SECOND
, or AxisIndicator.THIRD
.@Nonnull public static ElementaryRotation multiply(@Nonnull ElementaryRotation rotation, double scalar)
ElementaryRotation
by a scalar, yielding a new ElementaryRotation
.rotation
- The elementary rotation.scalar
- The scalar.@Nonnull public static ElementaryRotation multiply(double scalar, @Nonnull ElementaryRotation rotation)
ElementaryRotation
, yielding a new ElementaryRotation
.scalar
- The scalar.rotation
- The elementary rotation.@Nonnull public static UnitQuaternion multiply(@Nonnull ElementaryRotation rotation, @Nonnull UnitQuaternion quaternion)
rotation
- The elementary rotation.quaternion
- The unit quaternion.@Nonnull public static Matrix3By3 multiply(@Nonnull ElementaryRotation rotation, @Nonnull Matrix3By3 matrix)
rotation
- The elementary rotation.matrix
- The matrix.@Nonnull public static Matrix3By3 multiply(@Nonnull ElementaryRotation left, @Nonnull ElementaryRotation right)
ElementaryRotation
by a specified ElementaryRotation
, yielding a new Matrix3By3
.left
- The first rotation.right
- The second rotation.public boolean equals(Object obj)
equals
in class Object
obj
- The object to compare to this instance.true
if obj
is an instance of this type and represents the same value as this instance; otherwise false
.Object.hashCode()
,
HashMap
public final boolean equalsType(@Nonnull ElementaryRotation other)
equalsType
in interface IEquatable<ElementaryRotation>
other
- The instance to compare to this instance.true
if other
represents the same value as this instance; otherwise false
.public final boolean equalsEpsilon(@Nonnull ElementaryRotation other, double epsilon)
epsilon
of the same elements of the specified rotation. That is, in order for the rotations to be
considered equal (and for this function to return true), the absolute value of the
difference between each of their elements must be less than or equal to epsilon
.equalsEpsilon
in interface IEquatableEpsilon<ElementaryRotation>
other
- The rotation to compare to this rotation.epsilon
- The largest difference between the elements of the rotations for which they will be considered equal.public int hashCode()
hashCode
in class Object
Object.equals(java.lang.Object)
,
System.identityHashCode(java.lang.Object)
public String toString()
ElementaryRotation
coordinates in the form "axis, angle"public static boolean equals(@Nonnull ElementaryRotation left, @Nonnull ElementaryRotation right)
true
if the two instances are exactly equal.left
- The instance to compare to right
.right
- The instance to compare to left
.true
if left
represents the same value as right
; otherwise false
.public static boolean notEquals(@Nonnull ElementaryRotation left, @Nonnull ElementaryRotation right)
true
if the two instances are not exactly equal.left
- The instance to compare to right
.right
- The instance to compare to left
.true
if left
does not represent the same value as right
; otherwise false
.