The Quaternion Javascript class. Defines a 4 dimensional value. More...
Public Slots | |
void | setWXYZ (double w, double x, double y, double z) |
Sets the w, x, y, z values to the given values. More... | |
Quaternion | getConjugate () |
Returns the conjugate of the Quaternion. More... | |
Quaternion | getInverse () |
Returns the inverse of the Quaternion. More... | |
bool | isIdentity () |
Returns true if the Quaternion is the identity Quaternion. More... | |
bool | isEqual (Quaternion q2) |
Returns true if two Quaternions are equal. More... | |
bool | isNotEqual (Quaternion q2) |
Returns true if two Quaternions are NOT equal. More... | |
Point3d | toEuler (bool degrees=true) |
Returns a Point3d loaded with the Euler Angles corresponding to the Quaternion. More... | |
void | fromEuler (double eulerX, double eulerY, double eulerZ, bool degree=true) |
Initialize the quaternion from a trio of 3 successive Euler angles(degrees or radians). More... | |
Matrix4x4 | toMatrix () |
Returns a Matrix4x4 loaded with the Rotation Matrix corresponding to the Quaternion. More... | |
double | getNorm () |
Returns the norm of the Quaternion. More... | |
double | getDotProduct (Quaternion q2) |
Returns the dot product of the given Quaternion parameters. More... | |
Quaternion | multiply (Quaternion q2) |
Returns the multiplication product of the given Quaternion parameters. More... | |
Quaternion | getNormalized () |
Returns the normalized Quaternion. More... | |
Vector3d | rotateVector (Vector3d vect) |
Rotates a vector by the angle the Quaternion represents. More... | |
Public Member Functions | |
Quaternion () | |
Create a new identity Quaternion. More... | |
Quaternion (double w, double x, double y, double z) | |
Create a new Quaternion. More... | |
Properties | |
double | w |
The w value. More... | |
double | x |
The x value. More... | |
double | y |
The y value. More... | |
double | z |
The z value. More... | |
The Quaternion Javascript class. Defines a 4 dimensional value.
The Quaternion class defines a 4 dimensional value container, and is used to represent a rotation of a 3-D object.
Quaternion::Quaternion | ( | ) |
Create a new identity Quaternion.
The identity Quaternion is [1, 0, 0, 0].
Quaternion::Quaternion | ( | double | w, |
double | x, | ||
double | y, | ||
double | z | ||
) |
Create a new Quaternion.
w | : W value. |
x | : X value. |
y | : Y value. |
z | : Z value. |
|
slot |
Initialize the quaternion from a trio of 3 successive Euler angles(degrees or radians).
eulerX | : The angle around the x axis |
eulerY | : The angle around the y axis |
eulerZ | : The angle around the z axis |
degree | : True if the given angles are in degrees, false if they are in radians. |
|
slot |
Returns the conjugate of the Quaternion.
Changes the Quaternion to its inverse. When the norm of a Quaternion is 1, this is the same as invert().
|
slot |
Returns the dot product of the given Quaternion parameters.
The dot product of two Quaternions is the angle between the two rotations.
q2 | : The second Quaternion to use in the calculation. |
|
slot |
Returns the inverse of the Quaternion.
Changes the Quaternion to its inverse. When the norm of a Quaternion is 1, this is the same as conjugate(), but less efficient.
|
slot |
Returns the norm of the Quaternion.
The norm is the 4 dimensional euclidean length of the Quaternion.
|
slot |
Returns the normalized Quaternion.
Normalizing a Quaternion eliminates any errors in its calculation caused by floating-point precision.
A normalized Quaternion is one with a euclidean length (norm) of 1 (Unit length).
|
slot |
Returns true if two Quaternions are equal.
q2 | : The Quaternion to compare to. |
|
slot |
Returns true if the Quaternion is the identity Quaternion.
The identity Quaternion is [1, 0, 0, 0].
|
slot |
Returns true if two Quaternions are NOT equal.
q2 | : The Quaternion to compare to. |
|
slot |
Returns the multiplication product of the given Quaternion parameters.
The multiplication of two Quaternions is the combination of the 2 angles of the quaternions.
q2 | : The second Quaternion to use in the calculation. |
Rotates a vector by the angle the Quaternion represents.
vect | : The Vector3d to be rotated. |
|
slot |
Sets the w, x, y, z values to the given values.
w | : W value. |
x | : X value. |
y | : Y value. |
z | : Z value. |
|
slot |
Returns a Point3d loaded with the Euler Angles corresponding to the Quaternion.
degrees | : Whether or not the Euler Angles are in degrees or radians. (true for degrees) |
|
slot |
Returns a Matrix4x4 loaded with the Rotation Matrix corresponding to the Quaternion.
The Rotation Matrix is a 3x3 matrix used for rotating vectors.
|
readwrite |
The w value.
|
readwrite |
The x value.
|
readwrite |
The y value.
|
readwrite |
The z value.