TITLE: Simple expression for imaginary part of a quaternion
QUESTION [7 upvotes]: From a complex number, $z=x+iy$ and its conjugate there is a simple way to evaluate the real part and imaginary part,
\begin{equation}
\text{Re}(z)=\frac{z+z^*}{2}
\end{equation}
and
\begin{equation}
\text{Im}(z)=\frac{-i(z-z^*)}{2}
\end{equation}
I was wondering for a quaternion, $q=w+ix+jy+kz$, there is a similarly simple way to get Im($q$), or indeed any specific component?

REPLY [3 votes]: The conjugate can be defined purely in terms of quaternion addition and multiplication.
$q^*=-{1\over 2}(q+iqi+jqj+kqk)$
Then as mentioned in other answers:
$Re(q)={1\over 2}(q+q^*)$
$Im(q)={1\over 2}(q-q^*)$
Individual components can also be extracted.
If $q=w+ix+jy+kz$, then:
$iqi=i^2w+i^3x+ijiy+ikiz=-w-ix+jy+kz$
so:
${1\over 2}(q-iqi)=w+ix$
Hence:
${1\over 2}(q^*-iq^*i)=w-ix$
And we can subtract to find $x$. Similarly for $y$ and $z$ with $jqj$ and $kqk$.