Package com.irurueta.geometry
Class Quaternion
java.lang.Object
com.irurueta.geometry.Rotation3D
com.irurueta.geometry.Quaternion
- All Implemented Interfaces:
Serializable,Cloneable
Contains a representation of a 3D rotation in a more precise and compact way
than in matrix notation.
This implementation of a quaternion contains values in the basis 1, i, j, k
expressed as (a, b, c, d).
a value is related only to the rotation angle, while b, c, d values are related
both to the rotation axis and the rotation angle.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate doubleValue corresponding to real numbers basis.static final doubleThreshold of axis norm to convert quaternions to axis and rotation angle.private doubleValue corresponding to basis i.private doubleValue corresponding to basis j.private doubleValue corresponding to basis k.static final doubleLarge threshold of axis norm to convert quaternions to axis and rotation angle.static final intNumber of euler angles.static final intNumber of parameters contained in a quaternion.private booleanIndicates whether quaternion is normalized or not.static final doubleTrace threshold to convert rotation matrices into quaternions.Fields inherited from class com.irurueta.geometry.Rotation3D
DEFAULT_COMPARISON_THRESHOLD, DEFAULT_TYPE, DEFAULT_VALID_THRESHOLD, HOM_COORDS, INHOM_COORDS, MIN_THRESHOLD -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.Quaternion(double[] values) Constructor.Quaternion(double[] axis, double theta) Constructor.Quaternion(double roll, double pitch, double yaw) Constructor from euler angles.Quaternion(double a, double b, double c, double d) Constructor.Quaternion(AxisRotation3D axisRotation) Constructor from and axis 3D rotation.Quaternion(MatrixRotation3D matrixRotation) Constructor from matrix rotation.Quaternion(Quaternion quaternion) Constructor. -
Method Summary
Modifier and TypeMethodDescriptioncom.irurueta.algebra.MatrixReturns this 3D rotation instance expressed as a 4x4 homogeneous matrix.voidasHomogeneousMatrix(com.irurueta.algebra.Matrix result) Sets into provided Matrix instance this 3D rotation expressed as a 4x4 homogeneous matrix.com.irurueta.algebra.MatrixReturns this 3D rotation instance expressed as a 3x3 inhomogeneous matrix.voidasInhomogeneousMatrix(com.irurueta.algebra.Matrix result) Sets into provided Matrix instance this 3D rotation expressed as a 3x3 inhomogeneous matrix.clone()Returns a new quaternion instance containing the same data as this instance.voidCombines provided quaternion into this quaternion, resulting in the multiplication of both quaternion representations.static voidcombine(Quaternion q1, Quaternion q2, Quaternion result) Combines provided quaternions q1 and q2 to produce a resulting quaternion equivalent to the combined rotation of both quaternions.voidcombine(Rotation3D rotation) Combines provided rotation into this quaternion, resulting in the multiplication of both quaternion representations.Combines provided quaternion with this quaternion and returns the result as a new quaternion instance.combineAndReturnNew(Rotation3D rotation) Combines provided rotation with this quaternion and returns the result as a new quaternion instance.voidconjugate(Quaternion result) Computes the conjugate of this quaternion and stores the result into provided instance.voidconjugate(Quaternion result, com.irurueta.algebra.Matrix jacobian) Computes the conjugate of this quaternion and stores the result into provided instance.Computes the conjugate of this quaternion.voidcopyTo(Quaternion output) Copies this instance data into provided quaternion instance.static voideulerToMatrixRotation(double[] angles, MatrixRotation3D result) Computes the rotation matrix body-to-world corresponding to the body orientation given by the Euler angles (roll, pitch, yaw).static voideulerToMatrixRotation(double[] angles, MatrixRotation3D result, com.irurueta.algebra.Matrix jacobian) Computes the rotation matrix body-to-world corresponding to the body orientation given by the Euler angles (roll, pitch, yaw).static voideulerToMatrixRotation(double roll, double pitch, double yaw, MatrixRotation3D result) Computes the rotation matrix body-to-world corresponding to the body orientation given by the Euler angles (roll, pitch, yaw).static voideulerToMatrixRotation(double roll, double pitch, double yaw, MatrixRotation3D result, com.irurueta.algebra.Matrix jacobian) Computes the rotation matrix body-to-world corresponding to the body orientation given by the Euler angles (roll, pitch, yaw).voidfromHomogeneousMatrix(com.irurueta.algebra.Matrix m, double threshold) Sets amount of rotation from provided homogeneous rotation matrix.voidfromInhomogeneousMatrix(com.irurueta.algebra.Matrix m, double threshold) Sets amount of rotation from provided inhomogeneous rotation matrix.final voidfromQuaternion(Quaternion quaternion) Copies values from provided quaternion into this instance.voidSets values of this rotation from a 3D axis rotation.voidSets values of this rotation from a 3D matrix rotation.voidSets values of this rotation from a quaternion.doublegetA()Gets value corresponding to real numbers basis.doublegetB()Gets value corresponding to basis i.doublegetC()Gets value corresponding to basis j.doublegetD()Gets value corresponding to basis k.doubleReturns rotation amount or angle in radians around the rotation axis associated to this instance.getType()Returns type of this rotation.double[]Gets values that parameterize this quaternion.private voidinternalNormalize(double norm) Normalizes this quaternion if not already normalized.voidinverse()Inverts this quaternion.voidinverse(Quaternion result) Inverts this quaternion instance so that q * q^-1 = 1.static voidinverse(Quaternion q, Quaternion result) Inverts a quaternion so that q * q^-1 = 1.Inverts this quaternion instance so that q * q^-1 = 1.static QuaternionInverts a quaternion so that q * q^-1 = 1.voidReverses the rotation of this instance.voidinverseRotation(Quaternion result) Inverts this quaternion instance so that q * q^-1 = 1.voidinverseRotation(Rotation3D result) Sets into provided Rotation3D instance a rotation inverse to this instance.Returns a 3D rotation which is inverse to this instance.booleanIndicates whether quaternion is already normalized or not.static voidmatrixRotationToQuaternion(com.irurueta.algebra.Matrix r, Quaternion result) Converts rotation matrix into a quaternion.static voidmatrixRotationToQuaternion(MatrixRotation3D rotation, Quaternion result) Converts 3D matrix rotation into a quaternion.voidMultiplies this quaternion with provided one and stores the result in this instance.voidmultiply(Quaternion q, Quaternion result) Multiplies this quaternion with provided one and stores the result into provided instance.Multiplies this quaternion with provided one and returns the result as a new quaternion instance.voidNormalizes this quaternion if not already normalized.voidnormalize(com.irurueta.algebra.Matrix jacobian) Normalizes this quaternion if not already normalized and stores the corresponding jacobian into provided matrix (if provided).static voidproduct(Quaternion q1, Quaternion q2, Quaternion result) Multiplies quaternion q1 with quaternion q2 and stores the result into provided instance.static voidproduct(Quaternion q1, Quaternion q2, Quaternion result, com.irurueta.algebra.Matrix jacobianQ1, com.irurueta.algebra.Matrix jacobianQ2) Multiplies quaternion q1 with quaternion q2 and stores the result into provided instance.voidquaternionMatrix(com.irurueta.algebra.Matrix result) Converts this quaternion into a quaternion matrix so that the quaternion product q1 x q2 is equivalent to the matrix product: q1.toQuaternionMatrix().multiplyAndReturnNew(q2.toQuaternionMatrix())voidquaternionMatrixN(com.irurueta.algebra.Matrix result) Converts this quaternion into a quaternion matrix so that the quaternion product q1 x q2 is equivalent to the matrix product: q2.toQuaternionMatrixN().multiplyAndReturnNew(q1.toQuaternionMatrixN()).Returns a 3D point containing a rotated version of provided point.voidRotates a 3D point using the origin of coordinates as the axis of rotation.voidrotate(Point3D inputPoint, Point3D resultPoint, com.irurueta.algebra.Matrix jacobianPoint, com.irurueta.algebra.Matrix jacobianQuaternion) Rotates a 3D point using the origin of coordinates as the axis of rotation.static voidrotate(Quaternion q, Point3D inputPoint, Point3D resultPoint, com.irurueta.algebra.Matrix jacobianPoint, com.irurueta.algebra.Matrix jacobianQuaternion) Rotates a 3D point using the origin of coordinates as the axis of rotation.voidrotationAxis(double[] axis) Returns rotation axis corresponding to this instance.static voidrotationVectorToMatrixRotation(double[] rotationVector, com.irurueta.algebra.Matrix result) Converts a rotation vector into a rotation matrix.static voidrotationVectorToMatrixRotation(double[] rotationVector, MatrixRotation3D result) Converts a rotation vector into a rotation matrix.static voidrotationVectorToQuaternion(double[] rotationVector, Quaternion result) Converts a rotation vector (rotation axis having a norm equal to the rotation angle) into a quaternion.static voidrotationVectorToQuaternion(double[] rotationVector, Quaternion result, com.irurueta.algebra.Matrix jacobian) Converts a rotation vector (rotation axis having a norm equal to the rotation angle) into a quaternion, and stores the corresponding jacobian of the quaternion respect to the vector if provided.static doublerotationVectorToRotationAxisAndAngle(double[] rotationVector, double[] axis) Converts a rotation vector (rotation axis having a norm equal to the rotation angle) into a normalized rotation axis and its corresponding rotation angle.static doublerotationVectorToRotationAxisAndAngle(double[] rotationVector, double[] axis, com.irurueta.algebra.Matrix jacobianAlpha, com.irurueta.algebra.Matrix jacobianRotationVector) Converts a rotation vector (rotation axis having a norm equal to the rotation angle) into a normalized rotation axis and its corresponding rotation angle.voidsetA(double a) Sets value corresponding to real numbers basis.voidsetAxisAndRotation(double axisX, double axisY, double axisZ, double theta) Sets the axis and rotation of this instance.voidsetB(double b) Sets value corresponding to basis i.voidsetC(double c) Sets value corresponding to basis j.voidsetD(double d) Sets value corresponding to basis k.final voidsetFromAxisAndRotation(double[] axis, double theta) Sets quaternion parameters from axis and rotation values.voidsetFromAxisAndRotation(double[] axis, double theta, com.irurueta.algebra.Matrix jacobianOfTheta, com.irurueta.algebra.Matrix jacobianOfAxis) Sets quaternion parameters from axis and rotation values.final voidsetFromAxisAndRotation(double axisX, double axisY, double axisZ, double theta) Sets quaternion parameters from axis and rotation values.voidsetFromAxisAndRotation(double axisX, double axisY, double axisZ, double theta, com.irurueta.algebra.Matrix jacobianOfTheta, com.irurueta.algebra.Matrix jacobianOfAxis) Sets quaternion parameters from axis and rotation values.final voidsetFromAxisAndRotation(AxisRotation3D axisRotation) Sets quaternion parameters from an axis 3D rotation.voidsetFromAxisAndRotation(AxisRotation3D axisRotation, com.irurueta.algebra.Matrix jacobianOfTheta, com.irurueta.algebra.Matrix jacobianOfAxis) Sets quaternion parameters from an axis 3D rotation.voidsetFromEulerAngles(double[] angles) Sets quaternion from euler angles (roll, pitch and yaw).voidsetFromEulerAngles(double[] angles, com.irurueta.algebra.Matrix jacobian) Sets quaternion from euler angles.final voidsetFromEulerAngles(double roll, double pitch, double yaw) Sets quaternion from euler angles (roll, pitch and yaw).voidsetFromEulerAngles(double roll, double pitch, double yaw, com.irurueta.algebra.Matrix jacobian) Sets quaternion from euler angles (roll, pitch and yaw).voidsetFromMatrixRotation(com.irurueta.algebra.Matrix matrix) Sets quaternion values associated to provided rotation.final voidsetFromMatrixRotation(MatrixRotation3D rotation) Sets quaternion values associated to provided rotation.voidsetFromRotationVector(double[] rotationVector) Sets values of this quaternion from provided rotation vector.final voidsetValues(double[] values) Sets values that parameterize this quaternion in basis (1, i, j ,k).voidslerp(Quaternion q, double t, Quaternion result) Computes a linear interpolation between this quaternion and provided quaternion using provided value as the interpolation ratio and stores the result into provided result quaternion.static voidslerp(Quaternion q1, Quaternion q2, double t, Quaternion result) Computes a linear interpolation between provided quaternions using provided value as the interpolation ratio, and stores the result into provided result quaternion.slerpAndReturnNew(Quaternion q, double t) Computes a linear interpolation between this quaternion and provided quaternion using provided value as the interpolation ratio.static QuaternionslerpAndReturnNew(Quaternion q1, Quaternion q2, double t) Computes a linear interpolation between provided quaternions using provided value as the interpolation ratio.doubletoAxisAndRotationAngle(double[] axis) Computes rotation angle and axis.doubletoAxisAndRotationAngle(double[] axis, com.irurueta.algebra.Matrix jacobianAngle, com.irurueta.algebra.Matrix jacobianAxis) Computes rotation angle and axis of this instance.Converts this quaternion into an axis 3D rotation.voidtoAxisRotation(AxisRotation3D result) Converts this quaternion into an axis 3D rotation and stores the result into provided rotation instance.double[]Computes the euler angles (roll, pitch, yaw) resulting in an equivalent rotation to this quaternion.voidtoEulerAngles(double[] angles) Computes the euler angles (roll, pitch, yaw) equivalent to this quaternion rotation and stores the result into provided array.voidtoEulerAngles(double[] angles, com.irurueta.algebra.Matrix jacobian) Computes the euler angles (roll, pitch, yaw) equivalent to this quaternion rotation and stores the result into provided array.Converts this quaternion into a 3D matrix rotation.voidtoMatrixRotation(com.irurueta.algebra.Matrix result) Computes the matrix representing this quaternion rotation.voidtoMatrixRotation(com.irurueta.algebra.Matrix result, com.irurueta.algebra.Matrix jacobian) Computes the matrix representing this quaternion rotation.voidtoMatrixRotation(MatrixRotation3D result) Converts this quaternion into a 3D matrix rotation.voidtoQuaternion(Quaternion result) Converts this 3D rotation into a quaternion storing the result into provided instance.com.irurueta.algebra.MatrixConverts this quaternion into a quaternion matrix so that quaternion product q1 x q2 is equivalent to the matrix product: q1.toQuaternionMatrix().multiplyAndReturnNew(q2.toQuaternionMatrix())com.irurueta.algebra.MatrixConverts this quaternion into a quaternion matrix so that quaternion product q1 x q2 is equivalent to the matrix product: q2.toQuaternionMatrixN().multiplyAndReturnNew(q1.toQuaternionMatrixN()).voidtoRotationVector(double[] result) Computes rotation vector, which is equivalent to the rotation axis but having a norm equal to the rotation angle.voidtoRotationVector(double[] result, com.irurueta.algebra.Matrix jacobian) Computes rotation vector, which is equivalent to the rotation axis but having a norm equal to the rotation angle.voidvalues(double[] result) Stores values that parameterize this quaternion into provided array.Methods inherited from class com.irurueta.geometry.Rotation3D
create, create, create, create, create, create, equals, equals, equals, fromHomogeneousMatrix, fromInhomogeneousMatrix, fromMatrix, fromMatrix, fromRotation, getRotationAxis, hashCode, isValidRotationMatrix, isValidRotationMatrix, rotate, rotate, setAxisAndRotation, toQuaternion
-
Field Details
-
N_PARAMS
public static final int N_PARAMSNumber of parameters contained in a quaternion.- See Also:
-
N_ANGLES
public static final int N_ANGLESNumber of euler angles.- See Also:
-
AXIS_NORM_THRESHOLD
public static final double AXIS_NORM_THRESHOLDThreshold of axis norm to convert quaternions to axis and rotation angle.- See Also:
-
LARGE_AXIS_NORM_THRESHOLD
public static final double LARGE_AXIS_NORM_THRESHOLDLarge threshold of axis norm to convert quaternions to axis and rotation angle.- See Also:
-
TRACE_THRESHOLD
public static final double TRACE_THRESHOLDTrace threshold to convert rotation matrices into quaternions.- See Also:
-
a
private double aValue corresponding to real numbers basis. -
b
private double bValue corresponding to basis i. -
c
private double cValue corresponding to basis j. -
d
private double dValue corresponding to basis k. -
normalized
private boolean normalizedIndicates whether quaternion is normalized or not.
-
-
Constructor Details
-
Quaternion
public Quaternion()Default constructor. Creates a quaternion containing no rotation. -
Quaternion
public Quaternion(double a, double b, double c, double d) Constructor.- Parameters:
a- value corresponding to real numbers basis.b- value corresponding to basis i.c- value corresponding to basis j.d- value corresponding to basis k.
-
Quaternion
Constructor.- Parameters:
quaternion- quaternion to be copied from.
-
Quaternion
public Quaternion(double[] values) Constructor.- Parameters:
values- values to be stored in the quaternion expressed in the basis (1, i, j, k)- Throws:
IllegalArgumentException- if provided array does not have length 4.
-
Quaternion
public Quaternion(double[] axis, double theta) Constructor.- Parameters:
axis- a rotation axis.theta- a rotation angle expressed in radians.- Throws:
IllegalArgumentException- if provided axis array does not have length 3.
-
Quaternion
Constructor from and axis 3D rotation.- Parameters:
axisRotation- an axis 3D rotation.
-
Quaternion
public Quaternion(double roll, double pitch, double yaw) Constructor from euler angles.- Parameters:
roll- roll angle expressed in radians.pitch- pitch angle expressed in radians.yaw- yaw angle expressed in radians.
-
Quaternion
Constructor from matrix rotation.- Parameters:
matrixRotation- matrix rotation.
-
-
Method Details
-
getA
public double getA()Gets value corresponding to real numbers basis.- Returns:
- value corresponding to real numbers basis.
-
setA
public void setA(double a) Sets value corresponding to real numbers basis.- Parameters:
a- value corresponding to real numbers basis.
-
getB
public double getB()Gets value corresponding to basis i.- Returns:
- value corresponding to basis i.
-
setB
public void setB(double b) Sets value corresponding to basis i.- Parameters:
b- value corresponding to basis i.
-
getC
public double getC()Gets value corresponding to basis j.- Returns:
- value corresponding to basis j.
-
setC
public void setC(double c) Sets value corresponding to basis j.- Parameters:
c- value corresponding to basis j.
-
getD
public double getD()Gets value corresponding to basis k.- Returns:
- value corresponding to basis k.
-
setD
public void setD(double d) Sets value corresponding to basis k.- Parameters:
d- value corresponding to basis k.
-
getValues
public double[] getValues()Gets values that parameterize this quaternion.- Returns:
- values of this quaternion.
-
values
public void values(double[] result) Stores values that parameterize this quaternion into provided array.- Parameters:
result- array where quaternion parameters will be stored.- Throws:
IllegalArgumentException- if length of provided array is not 4.
-
setValues
public final void setValues(double[] values) Sets values that parameterize this quaternion in basis (1, i, j ,k).- Parameters:
values- values that parameterize this quaternion in basis (1, i, j, k).- Throws:
IllegalArgumentException- if provided array length is not 4.
-
fromQuaternion
Copies values from provided quaternion into this instance.- Parameters:
quaternion- quaternion to copy from.
-
clone
Returns a new quaternion instance containing the same data as this instance.- Overrides:
clonein classObject- Returns:
- a copy of this quaternion instance.
- Throws:
CloneNotSupportedException- if clone fails.
-
copyTo
Copies this instance data into provided quaternion instance.- Parameters:
output- destination instance where data is copied to.
-
setFromAxisAndRotation
public final void setFromAxisAndRotation(double axisX, double axisY, double axisZ, double theta) Sets quaternion parameters from axis and rotation values.- Parameters:
axisX- x coordinate of rotation axis.axisY- y coordinate of rotation axis.axisZ- z coordinate of rotation axis.theta- rotation angle expressed in radians.
-
setFromAxisAndRotation
public void setFromAxisAndRotation(double axisX, double axisY, double axisZ, double theta, com.irurueta.algebra.Matrix jacobianOfTheta, com.irurueta.algebra.Matrix jacobianOfAxis) Sets quaternion parameters from axis and rotation values.- Parameters:
axisX- x coordinate of rotation axis.axisY- y coordinate of rotation axis.axisZ- z coordinate of rotation axis.theta- rotation angle expressed in radians.jacobianOfTheta- if provided, matrix where jacobian of rotation angle will be stored. Must be a 4x1 matrix.jacobianOfAxis- if provided, matrix where jacobian of rotation axis will be stored. Must be a 4x3 matrix.- Throws:
IllegalArgumentException- if any of the provided jacobian matrices does not have proper size.- See Also:
-
setFromAxisAndRotation
public final void setFromAxisAndRotation(double[] axis, double theta) Sets quaternion parameters from axis and rotation values.- Parameters:
axis- axis values.theta- rotation angle expressed in radians.- Throws:
IllegalArgumentException- if provided axis array does not have length 3.
-
setFromAxisAndRotation
public void setFromAxisAndRotation(double[] axis, double theta, com.irurueta.algebra.Matrix jacobianOfTheta, com.irurueta.algebra.Matrix jacobianOfAxis) Sets quaternion parameters from axis and rotation values.- Parameters:
axis- axis values.theta- rotation angle expressed in radians.jacobianOfTheta- if provided, matrix where jacobian of rotation angle will be stored. Must be a 4x1 matrix.jacobianOfAxis- if provided, matrix where jacobian of rotation axis will be stored. Must be a 4x4 matrix.- Throws:
IllegalArgumentException- if provided axis array does not have length 3, or if any of the provided jacobian matrices does not have proper size.
-
setFromAxisAndRotation
Sets quaternion parameters from an axis 3D rotation.- Parameters:
axisRotation- an axis 3D rotation.
-
setFromAxisAndRotation
public void setFromAxisAndRotation(AxisRotation3D axisRotation, com.irurueta.algebra.Matrix jacobianOfTheta, com.irurueta.algebra.Matrix jacobianOfAxis) Sets quaternion parameters from an axis 3D rotation.- Parameters:
axisRotation- an axis 3D rotation.jacobianOfTheta- if provided, matrix where jacobian of rotation angle will be stored. Must be a 4x1 matrix.jacobianOfAxis- if provided, matrix where jacobian of rotation axis will be stored. Must be a 4x4 matrix.- Throws:
IllegalArgumentException- if any of the provided jacobian matrices does not have proper size.
-
multiply
Multiplies this quaternion with provided one and stores the result in this instance.- Parameters:
q- quaternion to multiply with.
-
multiplyAndReturnNew
Multiplies this quaternion with provided one and returns the result as a new quaternion instance.- Parameters:
q- quaternion to multiply with.- Returns:
- obtained result.
-
multiply
Multiplies this quaternion with provided one and stores the result into provided instance.- Parameters:
q- quaternion to multiply with.result- instance where result is stored.
-
product
Multiplies quaternion q1 with quaternion q2 and stores the result into provided instance.- Parameters:
q1- 1st product operator of quaternions.q2- 2nd product operator of quaternions.result- instance where result of product is stored.
-
product
public static void product(Quaternion q1, Quaternion q2, Quaternion result, com.irurueta.algebra.Matrix jacobianQ1, com.irurueta.algebra.Matrix jacobianQ2) Multiplies quaternion q1 with quaternion q2 and stores the result into provided instance. This method also computes the Jacobians wrt of Q1 and Q2 if provided.- Parameters:
q1- 1st product operator of quaternions.q2- 2nd product operator of quaternions.result- instance where result of product is stored.jacobianQ1- instance where jacobian of q1 is stored.jacobianQ2- instance where jacobian of q2 is stored.- Throws:
IllegalArgumentException- if any of the provided jacobian matrices is not 4x4.- See Also:
-
setFromEulerAngles
public void setFromEulerAngles(double roll, double pitch, double yaw, com.irurueta.algebra.Matrix jacobian) Sets quaternion from euler angles (roll, pitch and yaw).- Parameters:
roll- roll angle expressed in radians. Rotation around x-axis.pitch- pitch angle expressed in radians. Rotation around y-axis.yaw- yaw angle expressed in radians. Rotation around z-axis.jacobian- matrix where jacobian will be stored if provided.- Throws:
IllegalArgumentException- if provided jacobian matrix does not have size 4x3- See Also:
-
setFromEulerAngles
public final void setFromEulerAngles(double roll, double pitch, double yaw) Sets quaternion from euler angles (roll, pitch and yaw).- Parameters:
roll- roll angle expressed in radians. Rotation around x-axis.pitch- pitch angle expressed in radians. Rotation around y-axis.yaw- yaw angle expressed in radians. Rotation around z-axis.- See Also:
-
setFromEulerAngles
public void setFromEulerAngles(double[] angles, com.irurueta.algebra.Matrix jacobian) Sets quaternion from euler angles.- Parameters:
angles- euler angles expressed in radians in the following order: roll, pitch and yaw.jacobian- matrix where jacobian will be stored if provided.- Throws:
IllegalArgumentException- if provided array does not have length 3.
-
setFromEulerAngles
public void setFromEulerAngles(double[] angles) Sets quaternion from euler angles (roll, pitch and yaw).- Parameters:
angles- euler angles expressed in radians in the following order: roll, pitch and yaw.- Throws:
IllegalArgumentException- if provided array does not have length 3.
-
eulerToMatrixRotation
public static void eulerToMatrixRotation(double roll, double pitch, double yaw, MatrixRotation3D result, com.irurueta.algebra.Matrix jacobian) Computes the rotation matrix body-to-world corresponding to the body orientation given by the Euler angles (roll, pitch, yaw).- Parameters:
roll- roll angle expressed in radians. Rotation around x-axis.pitch- pitch angle expressed in radians. Rotation around y-axis.yaw- yaw angle expressed in radians. Rotation around z-axis.result- instance where computed rotation will be stored.jacobian- jacobian of computed rotation (optional).- Throws:
IllegalArgumentException- if provided jacobian is not 9x3.- See Also:
-
eulerToMatrixRotation
public static void eulerToMatrixRotation(double roll, double pitch, double yaw, MatrixRotation3D result) Computes the rotation matrix body-to-world corresponding to the body orientation given by the Euler angles (roll, pitch, yaw).- Parameters:
roll- roll angle expressed in radians. Rotation around x-axis.pitch- pitch angle expressed in radians. Rotation around y-axis.yaw- yaw angle expressed in radians. Rotation around z-axis.result- instance where computed rotation will be stored.- See Also:
-
eulerToMatrixRotation
public static void eulerToMatrixRotation(double[] angles, MatrixRotation3D result, com.irurueta.algebra.Matrix jacobian) Computes the rotation matrix body-to-world corresponding to the body orientation given by the Euler angles (roll, pitch, yaw).- Parameters:
angles- array containing roll, pitch and yaw angles.result- instance where computed rotation will be stored.jacobian- jacobian of computed rotation (optional).- Throws:
IllegalArgumentException- if provided angles length is not 3, or if provided jacobian is not 9x3.- See Also:
-
eulerToMatrixRotation
Computes the rotation matrix body-to-world corresponding to the body orientation given by the Euler angles (roll, pitch, yaw).- Parameters:
angles- array containing roll, pitch and yaw angles.result- instance where computed rotation will be stored.- Throws:
IllegalArgumentException- if provided angles length is not 3.- See Also:
-
toAxisAndRotationAngle
public double toAxisAndRotationAngle(double[] axis, com.irurueta.algebra.Matrix jacobianAngle, com.irurueta.algebra.Matrix jacobianAxis) Computes rotation angle and axis of this instance.- Parameters:
axis- array where normalized rotation axis will be stored.jacobianAngle- matrix where jacobian of angle will be stored, if provided. Must be 1x4.jacobianAxis- matrix where jacobian of axis will be stored, if provided. Must be 3x4.- Returns:
- rotation angle expressed in radians.
- Throws:
IllegalArgumentException- if length of axis or size of provided jacobians is not correct.- See Also:
-
toAxisAndRotationAngle
public double toAxisAndRotationAngle(double[] axis) Computes rotation angle and axis.- Parameters:
axis- normalized rotation axis.- Returns:
- rotation angle expressed in radians.
- Throws:
IllegalArgumentException- if length of axis is not 3.
-
toAxisRotation
Converts this quaternion into an axis 3D rotation and stores the result into provided rotation instance.- Overrides:
toAxisRotationin classRotation3D- Parameters:
result- rotation instance where result will be stored.
-
toAxisRotation
Converts this quaternion into an axis 3D rotation.- Overrides:
toAxisRotationin classRotation3D- Returns:
- a new axis 3D rotation equivalent to this quaternion.
-
toRotationVector
public void toRotationVector(double[] result, com.irurueta.algebra.Matrix jacobian) Computes rotation vector, which is equivalent to the rotation axis but having a norm equal to the rotation angle.- Parameters:
result- array where rotation vector is stored.jacobian- matrix where jacobian of vector will be stored, if provided.- Throws:
IllegalArgumentException- if length of result is not 3 or size of provided jacobian is not 3x4.- See Also:
-
toRotationVector
public void toRotationVector(double[] result) Computes rotation vector, which is equivalent to the rotation axis but having a norm equal to the rotation angle.- Parameters:
result- array where rotation vector is stored.- Throws:
IllegalArgumentException- if length of result is not 3.
-
toEulerAngles
public void toEulerAngles(double[] angles, com.irurueta.algebra.Matrix jacobian) Computes the euler angles (roll, pitch, yaw) equivalent to this quaternion rotation and stores the result into provided array. If provided, this method also computes the jacobian matrix.- Parameters:
angles- euler angles (roll, pitch, yaw).jacobian- matrix where jacobian is stored, if provided.- Throws:
IllegalArgumentException- if provided angles array length is not 3 or if provided jacobian matrix is not 3x4.- See Also:
-
toEulerAngles
public void toEulerAngles(double[] angles) Computes the euler angles (roll, pitch, yaw) equivalent to this quaternion rotation and stores the result into provided array.- Parameters:
angles- euler angles (roll, pitch, yaw).- Throws:
IllegalArgumentException- if provided angles array length is not 3.
-
toEulerAngles
public double[] toEulerAngles()Computes the euler angles (roll, pitch, yaw) resulting in an equivalent rotation to this quaternion.- Returns:
- euler angles (roll, pitch, yaw)
-
quaternionMatrix
public void quaternionMatrix(com.irurueta.algebra.Matrix result) Converts this quaternion into a quaternion matrix so that the quaternion product q1 x q2 is equivalent to the matrix product: q1.toQuaternionMatrix().multiplyAndReturnNew(q2.toQuaternionMatrix())- Parameters:
result- matrix where result will be stored.- Throws:
IllegalArgumentException- if provided matrix is not 4x4.- See Also:
-
toQuaternionMatrix
public com.irurueta.algebra.Matrix toQuaternionMatrix()Converts this quaternion into a quaternion matrix so that quaternion product q1 x q2 is equivalent to the matrix product: q1.toQuaternionMatrix().multiplyAndReturnNew(q2.toQuaternionMatrix())- Returns:
- the quaternion matrix.
- See Also:
-
conjugate
Computes the conjugate of this quaternion and stores the result into provided instance.- Parameters:
result- instance where result is stored.jacobian- matrix where jacobian is stored.- Throws:
IllegalArgumentException- if provided jacobian matrix is not 4x4.- See Also:
-
conjugate
Computes the conjugate of this quaternion and stores the result into provided instance.- Parameters:
result- instance where result is stored.- See Also:
-
conjugateAndReturnNew
Computes the conjugate of this quaternion.- Returns:
- conjugate of this quaternion.
- See Also:
-
quaternionMatrixN
public void quaternionMatrixN(com.irurueta.algebra.Matrix result) Converts this quaternion into a quaternion matrix so that the quaternion product q1 x q2 is equivalent to the matrix product: q2.toQuaternionMatrixN().multiplyAndReturnNew(q1.toQuaternionMatrixN()). Notice that matrix order in the product is the opposite as the order used when multiplying matrices obtained by method #toQuaternionMatrix().- Parameters:
result- matrix where result will be stored.- Throws:
IllegalArgumentException- if provided matrix is not 4x4.- See Also:
-
toQuaternionMatrixN
public com.irurueta.algebra.Matrix toQuaternionMatrixN()Converts this quaternion into a quaternion matrix so that quaternion product q1 x q2 is equivalent to the matrix product: q2.toQuaternionMatrixN().multiplyAndReturnNew(q1.toQuaternionMatrixN()). Notice that matrix order in the product is the opposite as the order used when multiplying matrices obtained by method #toQuaternionMatrix().- Returns:
- the quaternion matrix.
- See Also:
-
toMatrixRotation
public void toMatrixRotation(com.irurueta.algebra.Matrix result, com.irurueta.algebra.Matrix jacobian) Computes the matrix representing this quaternion rotation.- Parameters:
result- matrix where rotation data will be stored.jacobian- jacobian wrt of this quaternion.- Throws:
IllegalArgumentException- if provided result matrix is not 3x3 o jacobian matrix is not 9x4.- See Also:
-
toMatrixRotation
public void toMatrixRotation(com.irurueta.algebra.Matrix result) Computes the matrix representing this quaternion rotation.- Parameters:
result- matrix where rotation data will be stored.- Throws:
IllegalArgumentException- if provided result matrix is not 3x3.- See Also:
-
toMatrixRotation
Converts this quaternion into a 3D matrix rotation.- Overrides:
toMatrixRotationin classRotation3D- Parameters:
result- matrix rotation instance where result will be stored.- See Also:
-
toMatrixRotation
Converts this quaternion into a 3D matrix rotation.- Overrides:
toMatrixRotationin classRotation3D- Returns:
- a 3D matrix rotation.
- See Also:
-
rotate
public static void rotate(Quaternion q, Point3D inputPoint, Point3D resultPoint, com.irurueta.algebra.Matrix jacobianPoint, com.irurueta.algebra.Matrix jacobianQuaternion) Rotates a 3D point using the origin of coordinates as the axis of rotation. Point will be rotated by the amount of rotation contained in provided quaternion.- Parameters:
q- a quaternion.inputPoint- input point to be rotated.resultPoint- rotated point.jacobianPoint- jacobian wrt of point.jacobianQuaternion- jacobian wrt of quaternion.- Throws:
IllegalArgumentException- if jacobian of point is not 3x3 or jacobian of quaternion is not 3x4.- See Also:
-
rotate
public void rotate(Point3D inputPoint, Point3D resultPoint, com.irurueta.algebra.Matrix jacobianPoint, com.irurueta.algebra.Matrix jacobianQuaternion) Rotates a 3D point using the origin of coordinates as the axis of rotation. Point will be rotated by the amount of rotation contained in this quaternion instance.- Parameters:
inputPoint- input point to be rotated.resultPoint- rotated point.jacobianPoint- jacobian wrt of point.jacobianQuaternion- jacobian wrt of quaternion.- Throws:
IllegalArgumentException- if jacobian of point is not 3x3 or jacobian of quaternion is no 3x4.- See Also:
-
rotate
Rotates a 3D point using the origin of coordinates as the axis of rotation. Point will be rotated by the amount of rotation contained in this quaternion instance.- Specified by:
rotatein classRotation3D- Parameters:
inputPoint- Input point to be rotated.resultPoint- Rotated point.- See Also:
-
rotate
Returns a 3D point containing a rotated version of provided point. Point will be rotated using the origin of the coordinates as the axis of rotation. Point will be rotated by the amount of rotation contained in this quaternion instance.- Overrides:
rotatein classRotation3D- Parameters:
point- Point to be rotated.- Returns:
- Rotated point.
- See Also:
-
matrixRotationToQuaternion
Converts rotation matrix into a quaternion.- Parameters:
r- a rotation matrix to be converted from.result- quaternion where result is stored.- Throws:
IllegalArgumentException- if provided matrix is not 3x3- See Also:
-
matrixRotationToQuaternion
Converts 3D matrix rotation into a quaternion.- Parameters:
rotation- a 3D matrix rotation to be converted from.result- quaternion where result is stored.- See Also:
-
setFromMatrixRotation
public void setFromMatrixRotation(com.irurueta.algebra.Matrix matrix) Sets quaternion values associated to provided rotation.- Parameters:
matrix- a rotation matrix.- Throws:
IllegalArgumentException- if provided matrix is not 3x3.- See Also:
-
setFromMatrixRotation
Sets quaternion values associated to provided rotation.- Parameters:
rotation- a rotation to be converted into a quaternion.- See Also:
-
rotationVectorToRotationAxisAndAngle
public static double rotationVectorToRotationAxisAndAngle(double[] rotationVector, double[] axis, com.irurueta.algebra.Matrix jacobianAlpha, com.irurueta.algebra.Matrix jacobianRotationVector) Converts a rotation vector (rotation axis having a norm equal to the rotation angle) into a normalized rotation axis and its corresponding rotation angle.- Parameters:
rotationVector- input rotation vector to be converted.axis- obtained normalized rotation axis.jacobianAlpha- jacobian wrt of angle.jacobianRotationVector- jacobian wrt of rotation vector.- Returns:
- rotation angle.
- Throws:
IllegalArgumentException- if provided rotation vector length is not 3, jacobian of angle is not 1x3 or jacobian of rotation vector is not 3x3.- See Also:
-
rotationVectorToRotationAxisAndAngle
public static double rotationVectorToRotationAxisAndAngle(double[] rotationVector, double[] axis) Converts a rotation vector (rotation axis having a norm equal to the rotation angle) into a normalized rotation axis and its corresponding rotation angle.- Parameters:
rotationVector- input rotation vector to be converted.axis- obtained normalized rotation axis.- Returns:
- rotation angle.
- Throws:
IllegalArgumentException- if provided rotation vector length is not 3.- See Also:
-
rotationVectorToQuaternion
public static void rotationVectorToQuaternion(double[] rotationVector, Quaternion result, com.irurueta.algebra.Matrix jacobian) Converts a rotation vector (rotation axis having a norm equal to the rotation angle) into a quaternion, and stores the corresponding jacobian of the quaternion respect to the vector if provided.- Parameters:
rotationVector- input rotation vector to be converted.result- quaternion where result will be stored.jacobian- if provided, matrix where jacobian of the quaternion respect to the vector will be stored. Must be 4x3.- Throws:
IllegalArgumentException- if provided rotation vector is not length 3 or if provided jacobian matrix is not 4x3.- See Also:
-
rotationVectorToQuaternion
Converts a rotation vector (rotation axis having a norm equal to the rotation angle) into a quaternion.- Parameters:
rotationVector- input rotation vector to be converted.result- quaternion where result will be stored.- Throws:
IllegalArgumentException- if provided rotation vector is not length 3.- See Also:
-
setFromRotationVector
public void setFromRotationVector(double[] rotationVector) Sets values of this quaternion from provided rotation vector. A rotation vector is a rotation axis having a norm equal to the rotation angle.- Parameters:
rotationVector- input rotation vector to obtain quaternion values from.- Throws:
IllegalArgumentException- if provided rotation vector does not have length 3.- See Also:
-
rotationVectorToMatrixRotation
public static void rotationVectorToMatrixRotation(double[] rotationVector, com.irurueta.algebra.Matrix result) Converts a rotation vector into a rotation matrix. A rotation vector is a rotation axis having a norm equal to the rotation angle.- Parameters:
rotationVector- a rotation vector to be converted into a 3D matrix rotation.result- matrix where result is stored.- Throws:
IllegalArgumentException- if provided rotation vector does not have length 3.- See Also:
-
rotationVectorToMatrixRotation
Converts a rotation vector into a rotation matrix. A rotation vector is a rotation axis having a norm equal to the rotation angle.- Parameters:
rotationVector- a rotation vector to be converted into a 3D matrix rotation.result- 3D matrix rotation where result is stored.- Throws:
IllegalArgumentException- if provided rotation vector does not have length 3.- See Also:
-
getType
Returns type of this rotation.- Specified by:
getTypein classRotation3D- Returns:
- Type of this rotation.
-
setAxisAndRotation
public void setAxisAndRotation(double axisX, double axisY, double axisZ, double theta) Sets the axis and rotation of this instance. Once set, points will rotate around provided axis an amount equal to provided rotation angle in radians. Note: to avoid numerical instabilities and improve accuracy, axis coordinates should be normalized (e.g. norm equal to 1).- Specified by:
setAxisAndRotationin classRotation3D- Parameters:
axisX- X coordinate of rotation axis.axisY- Y coordinate of rotation axis.axisZ- Z coordinate of rotation axis.theta- Amount of rotation in radians.
-
rotationAxis
public void rotationAxis(double[] axis) Returns rotation axis corresponding to this instance. Result is stored in provided axis array, which must have length 3.- Specified by:
rotationAxisin classRotation3D- Parameters:
axis- Array where axis coordinates will be stored.- Throws:
IllegalArgumentException- Raised if provided array does not have length 3.
-
getRotationAngle
public double getRotationAngle()Returns rotation amount or angle in radians around the rotation axis associated to this instance.- Specified by:
getRotationAnglein classRotation3D- Returns:
- Rotation angle in radians.
-
asInhomogeneousMatrix
public com.irurueta.algebra.Matrix asInhomogeneousMatrix()Returns this 3D rotation instance expressed as a 3x3 inhomogeneous matrix. This is equivalent to call getInternalMatrix().- Specified by:
asInhomogeneousMatrixin classRotation3D- Returns:
- Rotation matrix expressed in inhomogeneous coordinates.
-
asInhomogeneousMatrix
public void asInhomogeneousMatrix(com.irurueta.algebra.Matrix result) Sets into provided Matrix instance this 3D rotation expressed as a 3x3 inhomogeneous matrix.- Specified by:
asInhomogeneousMatrixin classRotation3D- Parameters:
result- Matrix where rotation will be set.- Throws:
IllegalArgumentException- Raised if provided instance does not have size 3x3.
-
asHomogeneousMatrix
public com.irurueta.algebra.Matrix asHomogeneousMatrix()Returns this 3D rotation instance expressed as a 4x4 homogeneous matrix.- Specified by:
asHomogeneousMatrixin classRotation3D- Returns:
- Rotation matrix expressed in homogeneous coordinates.
-
asHomogeneousMatrix
public void asHomogeneousMatrix(com.irurueta.algebra.Matrix result) Sets into provided Matrix instance this 3D rotation expressed as a 4x4 homogeneous matrix.- Specified by:
asHomogeneousMatrixin classRotation3D- Parameters:
result- Matrix where rotation will be set.- Throws:
IllegalArgumentException- Raised if provided instance does not have size 4x4.
-
fromInhomogeneousMatrix
public void fromInhomogeneousMatrix(com.irurueta.algebra.Matrix m, double threshold) Sets amount of rotation from provided inhomogeneous rotation matrix. Provided matrix must be orthogonal (i.e. squared, non-singular, it's transpose must be its inverse) and must have determinant equal to 1. Provided matrix must also have size 3x3.- Specified by:
fromInhomogeneousMatrixin classRotation3D- Parameters:
m- Provided rotation matrix.threshold- Threshold to determine whether matrix is orthonormal.- Throws:
IllegalArgumentException- Raised if provided threshold is negative.Rotation3D.isValidRotationMatrix(Matrix)
-
fromHomogeneousMatrix
public void fromHomogeneousMatrix(com.irurueta.algebra.Matrix m, double threshold) Sets amount of rotation from provided homogeneous rotation matrix. Provided matrix must be orthogonal (i.e. squared, non-singular, it's transpose must be its inverse) and must have determinant equal to 1. Provided matrix must also have size 4x4, and its last row and column must be zero, except for element in last row and column which must be 1.- Specified by:
fromHomogeneousMatrixin classRotation3D- Parameters:
m- Provided rotation matrix.threshold- Threshold to determine whether matrix is orthonormal.- Throws:
IllegalArgumentException- Raised if provided threshold is negative.Rotation3D.isValidRotationMatrix(Matrix)
-
inverse
Inverts a quaternion so that q * q^-1 = 1.- Parameters:
q- quaternion to be inverted.result- quaternion instance where the result will be stored.
-
inverseAndReturnNew
Inverts a quaternion so that q * q^-1 = 1.- Parameters:
q- quaternion to be inverted.- Returns:
- a new quaternion containing the inverse.
-
inverse
Inverts this quaternion instance so that q * q^-1 = 1.- Parameters:
result- instance where quaternion inverse is stored.
-
inverseAndReturnNew
Inverts this quaternion instance so that q * q^-1 = 1.- Returns:
- a new quaternion containing the inverse of this quaternion.
-
inverse
public void inverse()Inverts this quaternion. -
inverseRotationAndReturnNew
Returns a 3D rotation which is inverse to this instance. In other words, the combination of this rotation with its inverse produces no change.- Specified by:
inverseRotationAndReturnNewin classRotation3D- Returns:
- Inverse 3D rotation.
-
inverseRotation
Inverts this quaternion instance so that q * q^-1 = 1.- Parameters:
result- instance where quaternion inverse is stored.
-
inverseRotation
Sets into provided Rotation3D instance a rotation inverse to this instance. The combination of this rotation with its inverse produces no change.- Specified by:
inverseRotationin classRotation3D- Parameters:
result- Instance where inverse rotation will be set.
-
inverseRotation
public void inverseRotation()Reverses the rotation of this instance.- Specified by:
inverseRotationin classRotation3D
-
combine
Combines provided quaternions q1 and q2 to produce a resulting quaternion equivalent to the combined rotation of both quaternions.- Parameters:
q1- 1st quaternion.q2- 2nd quaternion.result- combined quaternion where result is stored.
-
combineAndReturnNew
Combines provided quaternion with this quaternion and returns the result as a new quaternion instance.- Parameters:
q- input quaternion to be combined.- Returns:
- combined quaternion, which is equal to the multiplication of quaternions.
-
combine
Combines provided quaternion into this quaternion, resulting in the multiplication of both quaternion representations.- Parameters:
q- input quaternion to be combined.
-
combineAndReturnNew
Combines provided rotation with this quaternion and returns the result as a new quaternion instance.- Specified by:
combineAndReturnNewin classRotation3D- Parameters:
rotation- input rotation to be combined.- Returns:
- combined rotation, which is equal to the multiplication of the internal quaternion representations.
-
combine
Combines provided rotation into this quaternion, resulting in the multiplication of both quaternion representations.- Specified by:
combinein classRotation3D- Parameters:
rotation- input rotation to be combined.
-
fromRotation
Sets values of this rotation from a 3D matrix rotation.- Overrides:
fromRotationin classRotation3D- Parameters:
rot- 3D matrix rotation to set values from.
-
fromRotation
Sets values of this rotation from a 3D axis rotation.- Overrides:
fromRotationin classRotation3D- Parameters:
rot- an axis rotation to set values from.
-
fromRotation
Sets values of this rotation from a quaternion.- Specified by:
fromRotationin classRotation3D- Parameters:
q- a quaternion to set values from.
-
toQuaternion
Converts this 3D rotation into a quaternion storing the result into provided instance.- Overrides:
toQuaternionin classRotation3D- Parameters:
result- instance where result will be stored.
-
isNormalized
public boolean isNormalized()Indicates whether quaternion is already normalized or not.- Returns:
- true if quaternion is normalized, false otherwise.
-
normalize
public void normalize()Normalizes this quaternion if not already normalized. -
normalize
public void normalize(com.irurueta.algebra.Matrix jacobian) Normalizes this quaternion if not already normalized and stores the corresponding jacobian into provided matrix (if provided).- Parameters:
jacobian- matrix where jacobian will be stored (if provided). Must be 4x4.- Throws:
IllegalArgumentException- if provided jacobian is not 4x4.
-
slerpAndReturnNew
Computes a linear interpolation between this quaternion and provided quaternion using provided value as the interpolation ratio.- Parameters:
q- quaternion to interpolate.t- interpolation ratio. Must be a value between 0.0 and 1.0, both included. The closer the value is to 0.0, the more similar result will be to this instance. Conversely, the closer the value is to 1.0, the more similar result will be to q.- Returns:
- a new interpolated quaternion instance.
- Throws:
IllegalArgumentException- if provided interpolation ratio is not between 0.0 and 1.0, both included.
-
slerp
Computes a linear interpolation between this quaternion and provided quaternion using provided value as the interpolation ratio and stores the result into provided result quaternion.- Parameters:
q- quaternion to interpolate.t- interpolation ratio. Must be a value between 0.0 and 1.0, both included. The closer the value is to 0.0, the more similar result will be to this instance. Conversely, the closer the value is to 1.0, the more similar result will be to q.result- instance where interpolated quaternion will be stored.- Throws:
IllegalArgumentException- if provided interpolation ratio is not between 0.0 and 1.0, both included.
-
slerpAndReturnNew
Computes a linear interpolation between provided quaternions using provided value as the interpolation ratio.- Parameters:
q1- 1st quaternion to interpolate.q2- 2nd quaternion to interpolate.t- interpolation ratio. Must be a value between 0.0 and 1.0, both included. The closer the value is to 0.0, the more similar result will be to q1. Conversely, the closer the value is to 1.0, the more similar result will be to q2.- Returns:
- a new interpolated quaternion instance.
- Throws:
IllegalArgumentException- if provided interpolation ratio is not between 0.0 and 1.0, both included.
-
slerp
Computes a linear interpolation between provided quaternions using provided value as the interpolation ratio, and stores the result into provided result quaternion.- Parameters:
q1- 1st quaternion to interpolate.q2- 2nd quaternion to interpolate.t- interpolation ratio. Must be a value between 0.0 and 1.0, both included. The closer the value is to 0.0, the more similar result will be to q1. Conversely, the closer the value is to 1.0, the more similar result will be to q2.result- instance where interpolated quaternion will be stored.- Throws:
IllegalArgumentException- if provided interpolation ratio is not between 0.0 and 1.0, both included.
-
internalNormalize
private void internalNormalize(double norm) Normalizes this quaternion if not already normalized.- Parameters:
norm- norm to normalize this quaternion with.
-