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?


The imaginary axis in $\mathbb{C}$ is spanned by $\{i\}$, so it makes sense for $\mathrm{Im}()$ to extract the coefficient of $i$ from the expression $a+bi$ (with $a,b\in\mathbb{R}$). But in $\mathbb{H}$, the 3D real subspace of imaginary quaternions is not spanned by a single element ($\{\mathbf{i},\mathbf{j},\mathbf{k}\}$ is an orthonormal basis), the $\mathrm{Im}()$ operator cannot extract a single real number, instead of just gives the entire imaginary part, as a (purely) imaginary quaternion. That is, if $a$ is a real number and $\mathbf{b}$ is a vector (i.e. pure imaginary quaternion) then we define

$$ \mathrm{Re}(a+\mathbf{b})=a, \qquad \mathrm{Im}(a+\mathbf{b})=\mathbf{b}. $$

A quaternion $q$ and its conjugate $\bar{q}$ are then given by

$$ q=\mathrm{Re}(q)+\mathrm{Im}(q), \qquad \bar{q}=\mathrm{Re}(q)-\mathrm{Im}(q). $$

We can then solve

$$ \mathrm{Re}(q)=\tfrac{1}{2}\big(q+\bar{q}\big), \qquad \mathrm{Im}(q)=\tfrac{1}{2}\big(q-\bar{q}\big). $$

You can also get a specific component, but for many purposes $\mathbf{i},\mathbf{j},\mathbf{k}$ is an arbitrary basis. So say we want the $\mathbf{u}$-component, where $\mathbf{u}$ is any unit vector. If $\mathbf{v}$ is another vector, then we have the formula $\mathbf{uv}=-\mathbf{u}\cdot\mathbf{v}+\mathbf{u}\times\mathbf{v}$, which means the $\mathbf{u}$-component of $\mathbf{v}$ is given by

$$ \|\mathrm{proj}_\mathbf{u}\mathbf{v}\|=-\tfrac{1}{2}\big(\mathbf{uv}+\mathbf{vu}\big). $$

To extract the $\mathbf{u}$-component of an arbitrary quaternion $q$, then, we can set $\mathbf{v}=\mathrm{Im}(q)$ in the above formula. More generally, $\langle x,y\rangle=\mathrm{Re}(\bar{x}y)$ is the usual inner product on $\mathbb{H}$, so the projection of a quaternion $q$ onto a unit quaternion $p$ is given by $\mathrm{proj}_pq=\mathrm{Re}(\bar{p}q)p$, which means the $p$-component of $q$ is simply $\mathrm{Re}(\bar{p}q)$.


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:



${1\over 2}(q-iqi)=w+ix$


${1\over 2}(q^*-iq^*i)=w-ix$

And we can subtract to find $x$. Similarly for $y$ and $z$ with $jqj$ and $kqk$.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.