I'm using quaternions as a means to rotate an object in the application I'm developing. If one quaternion represents a rotation and the second quaternion represents another rotation, what does their multiplication represent? Many web sites talk about formulas and matrices, but I want to know what exactly are we doing multiplication for?
What does multiplication of two quaternions give?
66.4k Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail AtThere are 2 best solutions below
On
Consider the quaternions as a four-dimensional real algebra $\mathbb{H}$, where elements have the form $a+bi+cj+dk$ subject to the muliplication rules $i^2=j^2=k^2=ijk=-1$. Further, consider the function $f:\mathbb{R}^3\to\mathbb{H}$ defined by
$f(x_1,x_2,x_3)=x_1i+x_2j+x_3k$
and the imaginary projection $\iota:\mathbb{H}\to\mathbb{R}^3$ given by
$\iota(a+bi+ck+dk)=(b,c,d)$.
Then, the cross product of two vectors $x,y\in\mathbb{R}^3$ can be given by
$x\times y=\iota(f(x)f(y))$.
A similar procedure also works for the seven-dimensional cross product and the octonions, with the same sort of maps $f':\mathbb{R}^7\to\mathbb{O}$ and $\iota':\mathbb{O}\to\mathbb{R}^7$
But as was pointed out by fretty, one needs to be careful about commutativity in $\mathbb{H}$ (and associativity for that matter in the case of $\mathbb{O}$).
Multiplication of quaternions works pretty much the same way the multiplication of rotation (or transformation) matrices works. So multiplication of two quaternions combines the rotations, just as multiplying matrices does (e.g. in OpenGL glRotate() function).
A nice thing is that multiplication of two normalized quaternions again produces a normalized quaternion.
Quaternion inversion (or just conjugate for the normalized case) creates the inverse rotation (the same rotation in the opposite direction). This is arguably easier to compute (on current computers) than to calculate inverse of a rotation matrix (just have to negate w in quaternion, instead of transposing a rotation matrix).