Rotation output with quaternions

40 Views Asked by At

I am trying to use the output of the sandwich product, P’=QVQ, Q being the conjugate of Q

Say I wanted to rotate a point at $(1,0,0)$ a full 180 degrees around the y axis, so that it would end up at $(1,0,0)$, from my understanding first I find the quaternion of rotation, which is cosine of the angle/2 for the real part, and each vector part is sine of the angle over 2

So $q_0=\cos(a/2)$

$q_1=x\sin(a/2)$

$q_2=y\sin(a/2)$

$q_3=z\sin(a/2)$

As cosine of 90=0, the real part is gone As this is a rotation around purely the y axis, y=1, x and z are = 0

Sine 90=1, 1•1=1, so my quaternions is just 1j, or j

My point as a quaternions should just be i

j times i is -k The conjugate of j is -j -k times -j= -(-i)=i But that’s just the same point we started with, so no rotation happened

2

There are 2 best solutions below

1
On

Too long for a comment.

You use the right quaternion $\mathbf{j}$ except that you do not multiply quaternions correctly. They follow the rules $$ \mathbf{i\,j=k} $$ where a minus sign must be added when an uneven permutation is applied. In particular, $$ \mathbf{j\,i=-k}\,. $$ Using $\mathbf{j}^2=-1$ we also get $$ \quad\mathbf{k\,j=-i}\,. $$ Then, rotating $V=(1,0,0)$ around the $y$-axis by 180 degrees is: $$ V=\mathbf{i} $$ \begin{align} a&=\pi\,, &Q&=\mathbf{j}\,,&Q^\dagger&=-\mathbf{j}\,,&Q^\dagger VQ=-\mathbf{j}\,\mathbf{i}\,\mathbf{j}=\mathbf{k}\,\mathbf{j}=-\mathbf{i}=-V \end{align} as expected.

To address your comment: In this case it does not matter on which $Q$ we put the $\dagger\,:$ $$ QVQ^\dagger=\mathbf{j\,i\,(-j)}=-\mathbf{j\,i\,j}=-\mathbf{i}\,. $$

0
On

The formula $V' = Q \cdot V \cdot \overline{Q}$ works. You just did a little mistake in the end. If done correctly it would be:

The rotation around the $y$-axis aka $\left( Q_{x},\, Q_{y},\, Q_{z} \right) = \left( 0,\, 1,\, 0 \right)$ by $\alpha = 180^{\circ}$ implies $$ \begin{align*} \vec{Q} ~\widehat{=} \begin{pmatrix} q_{0}\\ q_{1}\\ q_{2}\\ q_{3}\\ \end{pmatrix} = \begin{pmatrix} \cos\left( \frac{\alpha}{2} \right)\\ Q_{x} \cdot \sin\left( \frac{\alpha}{2} \right)\\ Q_{y} \cdot \sin\left( \frac{\alpha}{2} \right)\\ Q_{z} \cdot \sin\left( \frac{\alpha}{2} \right)\\ \end{pmatrix} = \begin{pmatrix} \cos\left( \frac{180^{\circ}}{2} \right)\\ 0 \cdot \sin\left( \frac{180^{\circ}}{2} \right)\\ 1 \cdot \sin\left( \frac{180^{\circ}}{2} \right)\\ 0 \cdot \sin\left( \frac{180^{\circ}}{2} \right)\\ \end{pmatrix} = \begin{pmatrix} 0\\ 0\\ 1\\ 0\\ \end{pmatrix} \end{align*} $$

aka $Q = 0 + 0 \cdot i + 1 \cdot j + 0 \cdot k = j \Longleftrightarrow \overline{Q} = -j$. The point we whant to rotate $V ~\widehat{=} \begin{pmatrix} 1\\ 0\\ 0\\ \end{pmatrix}$ wich implies $V = 1 \cdot i + 0 \cdot j + 0 \cdot k = i$.

This gives us: $$ \begin{align*} V' &= Q \cdot V \cdot \overline{Q}\\ V' &= j \cdot i \cdot \left( -j \right) = \left( j \cdot i \right) \cdot \left( -j \right)\\ V' &= -k \cdot \left( -j \right)\\ V' &= --\left( k \cdot j \right) = k \cdot j\\ V' &= -i\\ \end{align*} $$

aka $\vec{V'} ~\widehat{=} \begin{pmatrix} -1\\ 0\\ 0\\ \end{pmatrix}$ wich is $V$ when rotaded $180^{\circ}$ around the $y$-axis.