Quaternion
Quaternion is a adding operator Group. It isn’t a Field and the missing part is commutative of multiplication.
Format
Algebra
Conjugate
Norm
Inverse
Identity
For adding group, the identity element is real number \(0\). For multiplication, the identity element is real number \(1\).
Associativity
The associativity holds for every \(x, y, z \in G\) in both adding and multiplication:
Distributive
Commutative
Only true for adding
Not true for multiplication.
DO NOT USE \(p/q\) since it isn’t clear whether it is \(pq^{-1}\) or \(q^{-1}q\).
## Quaternions for rotations
Vector
A vector in three-dimensional space can be expressed as a pure quaternion, a quaternion with no real part: \(q = 0 + bi + cj + dk\).
Rotation Matrix
A rotation can be expressed by a quaternion \(q\) if
From quaternion to a rotation matrix
A rotation from one coordinate frame \(A\) to another frame \(B\) is given by the conjugation operation of transform quaternion \(q_R\) :
Assuming \(q_A\) represent a vector or a point in \(R^3\), we have
The transform result is
If we express this in a matrix formulation
in which
From a rotation matrix of angles to a quaternion
We can solve this equation for \(a\):
Once we have \(a\), we can obtain \(b\) from \(M_{11}\)
Similarly, \(c\) and \(d\) can be computed from \(M_{22}\) and \(M_{33}\).
From Euler angles to a quaternion
The general logic is simple
From Euler angels, construct its rotation matrix.
Convert rotation matrix to quaternion.