public class Quaternion<FLOAT_TYPE extends AbstractFloat = Double>
Hamilton quaternion, with scalar component first. Components need not form a unit quaternion; use geometry.Rotation3d for rotations.
q = Quaternion<Double>(1.0, 0.0, 0.0, 0.0)
| Modifier and Type | Member | Description |
|---|---|---|
| public property | ww as FLOAT_TYPE |
Scalar component. |
| public property | xx as FLOAT_TYPE |
First imaginary component. |
| public propert | yy y as FLOAT_TYPE |
Second imaginary component. |
| public property | zz as FLOAT_TYPE |
Third imaginary component. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | QuaternionQuaternion(w as FLOAT_TYPE = FLOAT_TYPE(0), x as FLOAT_TYPE = FLOAT_TYPE(0), y as FLOAT_TYPE = FLOAT_TYPE(0), z as FLOAT_TYPE = FLOAT_TYPE(0)) |
Creates a quaternion (w, x, y, z). |
| Modifier and Type | Member | Description |
|---|---|---|
| public | conjugateconjugate() as Quaternion<FLOAT_TYPE> |
Returns the conjugate. |
| public | inverseinverse() as Quaternion<FLOAT_TYPE> |
Returns the multiplicative inverse. |
| public | normnorm() as Double |
Scaled Euclidean norm, avoiding intermediate overflow. |
| public | normalizednormalized() as Quaternion<Double> |
Returns a unit quaternion. |
| Modifier and Type | Member | Description |
|---|---|---|
| public static | operator*(a as Quaternion<FLOAT_TYPE>, b as Quaternion<FLOAT_TYPE>) as Quaternion<FLOAT_TYPE> | Hamilton product; multiplication is not commutative. |
| public static | operator*(q as Quaternion<FLOAT_TYPE>, scale as FLOAT_TYPE) as Quaternion<FLOAT_TYPE> | Scalar product. |
| public static | operator+(a as Quaternion<FLOAT_TYPE>, b as Quaternion<FLOAT_TYPE>) as Quaternion<FLOAT_TYPE> | Component sum. |
| public static | operator-(a as Quaternion<FLOAT_TYPE>, b as Quaternion<FLOAT_TYPE>) as Quaternion<FLOAT_TYPE> | Component difference. |