| Modifier and Type | Field and Description |
|---|---|
| public static final Quaternion | I
i |
| public static final Quaternion | IDENTITY
Identity quaternion. |
| public static final Quaternion | J
j |
| public static final Quaternion | K
k |
| private final double | q0
First component (scalar part). |
| private final double | q1
Second component (first vector part). |
| private final double | q2
Third component (second vector part). |
| private final double | q3
Fourth component (third vector part). |
| private static final long | serialVersionUID
Serializable version identifier. |
| public static final Quaternion | ZERO
Zero quaternion. |
| Access | Constructor and Description |
|---|---|
| public | Quaternion(final double
Scalar component. a, final double First vector component. b, final double Second vector component. c, final double Third vector component. d)Builds a quaternion from its components. |
| public | Quaternion(final double
Scalar part of the quaternion. scalar, final double[] Components of the vector part of the quaternion. v)Builds a quaternion from scalar and vector parts. |
| public | Quaternion(final double[]
Components of the vector part of the pure quaternion. v)Builds a pure quaternion from a vector (assuming that the scalar part is zero). |
| Modifier and Type | Method and Description |
|---|---|
| public static Quaternion | Returns: the sum ofq1 and q2.Quaternion. q1, final Quaternion Quaternion. q2)Computes the sum of two quaternions. |
| public Quaternion | Returns: the sum of this instance andqQuaternion. q)Computes the sum of the instance and another quaternion. |
| public static double | Returns: the dot product ofq1 and q2.Quaternion. q1, final Quaternion Quaternion. q2)Computes the dot-product of two quaternions. |
| public double | Returns: the dot product of this instance andq.Quaternion. q)Computes the dot-product of the instance by a quaternion. |
| public boolean | equals(Object
the reference object with which to compare. other)Overrides java. Indicates whether some other object is "equal to" this one. |
| public boolean | Returns: true if the each of the components are equal
within the allowed absolute error.Quaternion with which to compare the current quaternion. q, final double Tolerance. eps)Checks whether this instance is equal to another quaternion within a given tolerance. |
| public Quaternion | |
| public Quaternion | |
| public double | |
| public Quaternion | Returns: the unit quaternion with positive scalar part.Returns the polar form of the quaternion. |
| public double | |
| public double | Returns: the first component of the vector part.Gets the second component of the quaternion (first component of the vector part). |
| public double | Returns: the second component of the vector part.Gets the third component of the quaternion (second component of the vector part). |
| public double | Returns: the third component of the vector part.Gets the fourth component of the quaternion (third component of the vector part). |
| public double | |
| public double[] | Returns: the vector part.Gets the three components of the vector part of the quaternion. |
| public int | |
| public boolean | Returns: true if the scalar part of the quaternion is zero.Tolerance (absolute error). eps)Checks whether the instance is a pure quaternion within a given tolerance. |
| public boolean | Returns: true if the norm is 1 within the given tolerance,
false otherwiseTolerance (absolute error). eps)Checks whether the instance is a unit quaternion within a given tolerance. |
| public static Quaternion | Returns: the productq1 and q2, in that order.First quaternion. q1, final Quaternion Second quaternion. q2)Returns the Hamilton product of two quaternions. |
| public Quaternion | Returns: the product of this instance withq, in that order.Quaternion. q)Returns the Hamilton product of the instance by a quaternion. |
| public Quaternion | Returns: a scaled quaternion.Scalar factor. alpha)Multiplies the instance by a scalar. |
| public Quaternion | Returns: a normalized quaternion.Computes the normalized quaternion (the versor of the instance). |
| public static Quaternion | Returns: the difference betweenq1 and q2.First Quaternion. q1, final Quaternion Second quaternion. q2)Subtracts two quaternions. |
| public Quaternion | Returns: the difference between this instance andq.Quaternion. q)Subtracts a quaternion from the instance. |
| public String |
| I | back to summary |
|---|---|
| public static final Quaternion I i | |
| IDENTITY | back to summary |
|---|---|
| public static final Quaternion IDENTITY Identity quaternion. | |
| J | back to summary |
|---|---|
| public static final Quaternion J j | |
| K | back to summary |
|---|---|
| public static final Quaternion K k | |
| q0 | back to summary |
|---|---|
| private final double q0 First component (scalar part). | |
| q1 | back to summary |
|---|---|
| private final double q1 Second component (first vector part). | |
| q2 | back to summary |
|---|---|
| private final double q2 Third component (second vector part). | |
| q3 | back to summary |
|---|---|
| private final double q3 Fourth component (third vector part). | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Serializable version identifier. | |
| ZERO | back to summary |
|---|---|
| public static final Quaternion ZERO Zero quaternion. | |
| Quaternion | back to summary |
|---|---|
| public Quaternion(final double a, final double b, final double c, final double d) Builds a quaternion from its components.
| |
| Quaternion | back to summary |
|---|---|
| public Quaternion(final double scalar, final double[] v) throws DimensionMismatchException Builds a quaternion from scalar and vector parts.
| |
| Quaternion | back to summary |
|---|---|
| public Quaternion(final double[] v) Builds a pure quaternion from a vector (assuming that the scalar part is zero).
| |
| add | back to summary |
|---|---|
| public static Quaternion add(final Quaternion q1, final Quaternion q2) Computes the sum of two quaternions.
| |
| add | back to summary |
|---|---|
| public Quaternion add(final Quaternion q) Computes the sum of the instance and another quaternion.
| |
| dotProduct | back to summary |
|---|---|
| public static double dotProduct(final Quaternion q1, final Quaternion q2) Computes the dot-product of two quaternions.
| |
| dotProduct | back to summary |
|---|---|
| public double dotProduct(final Quaternion q) Computes the dot-product of the instance by a quaternion.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object other) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| equals | back to summary |
|---|---|
| public boolean equals(final Quaternion q, final double eps) Checks whether this instance is equal to another quaternion within a given tolerance.
| |
| getConjugate | back to summary |
|---|---|
| public Quaternion getConjugate() Returns the conjugate quaternion of the instance.
| |
| getInverse | back to summary |
|---|---|
| public Quaternion getInverse() Returns the inverse of this instance. The norm of the quaternion must not be zero.
| |
| getNorm | back to summary |
|---|---|
| public double getNorm() Computes the norm of the quaternion.
| |
| getPositivePolarForm | back to summary |
|---|---|
| public Quaternion getPositivePolarForm() Returns the polar form of the quaternion.
| |
| getQ0 | back to summary |
|---|---|
| public double getQ0() Gets the first component of the quaternion (scalar part).
| |
| getQ1 | back to summary |
|---|---|
| public double getQ1() Gets the second component of the quaternion (first component of the vector part).
| |
| getQ2 | back to summary |
|---|---|
| public double getQ2() Gets the third component of the quaternion (second component of the vector part).
| |
| getQ3 | back to summary |
|---|---|
| public double getQ3() Gets the fourth component of the quaternion (third component of the vector part).
| |
| getScalarPart | back to summary |
|---|---|
| public double getScalarPart() Gets the scalar part of the quaternion.
| |
| getVectorPart | back to summary |
|---|---|
| public double[] getVectorPart() Gets the three components of the vector part of the quaternion. | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| isPureQuaternion | back to summary |
|---|---|
| public boolean isPureQuaternion(double eps) Checks whether the instance is a pure quaternion within a given tolerance.
| |
| isUnitQuaternion | back to summary |
|---|---|
| public boolean isUnitQuaternion(double eps) Checks whether the instance is a unit quaternion within a given tolerance.
| |
| multiply | back to summary |
|---|---|
| public static Quaternion multiply(final Quaternion q1, final Quaternion q2) Returns the Hamilton product of two quaternions.
| |
| multiply | back to summary |
|---|---|
| public Quaternion multiply(final Quaternion q) Returns the Hamilton product of the instance by a quaternion.
| |
| multiply | back to summary |
|---|---|
| public Quaternion multiply(final double alpha) Multiplies the instance by a scalar.
| |
| normalize | back to summary |
|---|---|
| public Quaternion normalize() Computes the normalized quaternion (the versor of the instance). The norm of the quaternion must not be zero.
| |
| subtract | back to summary |
|---|---|
| public static Quaternion subtract(final Quaternion q1, final Quaternion q2) Subtracts two quaternions.
| |
| subtract | back to summary |
|---|---|
| public Quaternion subtract(final Quaternion q) Subtracts a quaternion from the instance.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |