Quaternion sandwich simplification gives me a term too many

562 Views Asked by At

Context: I'm reading Foundations of Game Engine Development by Eric Lengyel. On the topic of rotations with quaternions it is explained that a vector v can be rotated by being "sandwiched" by quaternions: v' = $qvq^{-1}$. When the quaternion is a unit-quaternion, the conjugate of q (denoted q*) is equal to $q^{-1})$ , such that v' = qvq*

To demonstrate how the sandwich product shown in this equation performs a rotation, the quaternion is split into a vector and a scalar part: q = b + c.
v is treated like a pure quaternion so doesn't have a scalar part.

The book gives the following formula: $$\mathbf{q}\mathbf{v}\mathbf{q^*} = (\mathbf{b} \times \mathbf{v} + c\mathbf{v} - \mathbf{b} \cdot \mathbf{v})(-\mathbf{b} + c)$$

Problem:
According to the author, the right side can be simplified to: $$=(c^2 - b^2)\mathbf{v} + 2(\mathbf{v} \cdot \mathbf{b})\mathbf{b} + 2c(\mathbf{b} \times \mathbf{v})$$

But when I try to work this out myself, I have a term more, and I don't know how he got rid of it. For me it looks like this: $$ = (\color{red}{\mathbf{b} \times \mathbf{v} \times \mathbf{-b})} -c(\mathbf{v} \times \mathbf{b}) + \mathbf{b}(\mathbf{b} \cdot \mathbf{v}) + c(\mathbf{b} \times \mathbf{v}) + c^{2}\mathbf{v} + c(\mathbf{b} \cdot \mathbf{v}) $$

$$ = \color{red}{\mathbf{v}(\mathbf{b} \cdot \mathbf{-b}) + \mathbf{b}(\mathbf{b} \cdot \mathbf{v})}\color{blue}{ -c(\mathbf{v} \times \mathbf{b})} + \mathbf{b}(\mathbf{b} \cdot \mathbf{v})\color{blue}{ + c(\mathbf{b} \times \mathbf{v})} + c^{2}\mathbf{v} + c(\mathbf{b} \cdot \mathbf{v}) $$

$$ = \color{red}{-b^2\mathbf{v} + \mathbf{b}(\mathbf{b} \cdot \mathbf{v})} + \color{blue}{2c(\mathbf{b} \times \mathbf{v})} + \mathbf{b}(\mathbf{b} \cdot \mathbf{v}) + c^{2}\mathbf{v} + c(\mathbf{b} \cdot \mathbf{v}) $$

$$ = \color{green}{-b^2\mathbf{v}} \color{brown}{+ \mathbf{b}(\mathbf{b} \cdot \mathbf{v})} + 2c(\mathbf{b} \times \mathbf{v}) \color{brown}{+ \mathbf{b}(\mathbf{b} \cdot \mathbf{v})} \color{green}{+ c^{2}\mathbf{v}} + c(\mathbf{b} \cdot \mathbf{v}) $$

$$ = \color{green}{(c^2-b^2)\mathbf{v}} \color{brown}{+ 2\mathbf{b}(\mathbf{b} \cdot \mathbf{v})} + 2c(\mathbf{b} \times \mathbf{v})+ c(\mathbf{b} \cdot \mathbf{v}) $$

I hope the colours make it clear how I simplified. My simplification looks the same except that I end up with an extra term $c(\mathbf{b} \cdot \mathbf{v})$.

Did I make a mistake? Or does the last term equate to zero somehow in this context?
Some help would be greatly appreciated.

1

There are 1 best solutions below

0
On BEST ANSWER

Your mistake comes at the first step. Remember quaternion multiplication is $(a+\mathbf{b})(c+\mathbf{d})=(ac-\mathbf{b}\cdot\mathbf{d})+(c\mathbf{b}+a\mathbf{d}+\mathbf{b}\times\mathbf{d})$ so you should get \begin{align*}\require{cancel} &(\mathbf{b} \times \mathbf{v} + c\mathbf{v} - \mathbf{b} \cdot \mathbf{v})(-\mathbf{b} + c)\\ &=[(- \mathbf{b} \cdot \mathbf{v})(c)-((\mathbf{b} \times \mathbf{v} + {\color{blue}{c\mathbf{v}}})\cdot(-\mathbf{b})]\\ &\quad+[(- \mathbf{b} \cdot \mathbf{v})(-\mathbf{b})+c(\mathbf{b}\times\mathbf{v}+c\mathbf{v})+(\mathbf{b}\times\mathbf{v}+c\mathbf{v})\times(- \mathbf{b} \cdot \mathbf{v})(-\mathbf{b})]\\ \end{align*} you missed my blue term there.

Also, since $\times$ is not associative, $\mathbf{b}\times\mathbf{v}\times(-\mathbf{b})$ is slightly ambiguous.