# How can I find a unit velocity vector between two quaternions?

I have two quaternions, $Q_0$ and $Q_1$. I want to find the unit angular velocity vector $w$ that rotates $Q_0$ in the direction of $Q_1$ (shortest path). How can I do this?

The analog of what I want in terms of linear velocity is to take points $P_0$ and $P_1$, and find the vector $v = (P_0-P_1)/||P_0-P_1||$.

• Are $Q_k$ full or imaginary quaternions? Same length $|Q_0|=|Q_1|$? With rotation you mean an operation $Q_1=W^{-1}Q_0W$ with $W=\cos\phi/2+w\sin\phi/2$ where $w$ is an imaginary unit quaternion? Feb 23, 2014 at 10:01
• You can assume that they are both unit quaternions representing rotations. Feb 23, 2014 at 18:15
• Ok, if $Q_{0,1}$ themselves are rotations, then you are looking for $Q_1=Q_0W$ or $W=Q_0^{-1}Q_1=\cos ϕ +w\sin ϕ$ and one arc from $Q_0$ to $Q_1$ is $Q(t)=Q_0(\cos(tϕ) +w\sin(tϕ))$ for $t\in[0,1]$. This is by no means unique, one could also start with $Q_1=WQ_0$ to obtain a different path. I'm not sure that in $S^3$ uniqueness of shortest paths is as simple as in $S^2$. Feb 23, 2014 at 18:43
• No, the path is unique, and has a symmetric formulation that is independent of the computation approach. Feb 23, 2014 at 19:22

Given that $Q_0$ and $Q_1$ are unit quaternions, i.e., located on the 3-sphere $S^3$, the question for the shortest path from $Q_0$ to $Q_1$ can be rotated by left multiplication with $Q_0^{-1}$ to the question of the shortest path from $1$ to $W=Q_0^{-1}Q_1\in S^3$.
Now represent $W$ as $\cosϕ+w\sinϕ$, $ϕ\in[0,\pi]$, $|w|=1$, $Re(w)=0$, the obvious shortest arc on the sphere is given by $W(t)=\cos(tϕ)+w\sin(tϕ)$, $t\in[0,1]$. Rotating the solution back to the initial situation gives
$$Q(t)=Q_0W(t)=Q_0(\cos(tϕ)+w\sin(tϕ))$$
And since $w=(Q_0^{-1}Q_1-\cosϕ)/\sinϕ$, one has the more symmetric formula
$$Q(t)=Q_0\frac{\sin((1-t)ϕ)}{\sinϕ}+Q_1\frac{\sin(tϕ)}{\sinϕ}$$