Applying quaternion rotation incorrectly I seem to be making a mistake performing a quaternion rotation. Given two unit vectors $v$ and $w$, I want to compute the rotation between vector $v$, and $w$ and apply that same rotation vector $x$.
Let $\vec{v}$, $\vec{w}$, $\vec{x}$ be unit vectors.
Let $\bf x$ be the quaternion representation of $\vec{x}$, $(0 + x_1i + x_2j + x_3k)$
I compute the following (where $\cdot$ represents the dot product and $\times$ represents the cross product):
$\vec{u} = \frac{\vec{v} \times \vec{w}}{\lVert \vec{v} \times \vec{w} \rVert}$
$\theta = acos(\vec{v} \cdot \vec{w})$
${\bf q} = cos(\theta / 2) + {\bf u} \cdot sin(\theta/2)$
${\bf q^{-1}} = cos(\theta / 2) - {\bf u} \cdot sin(\theta/2)$
I now expect that I can compute $x'$ such that:
$\vec{x} \cdot \vec{x}' = \vec{v} \cdot \vec{w}$
Where $x'$ is computed via quaternion multiplication:
${\bf x'} = {\bf qxq^{-1}}$
Did I make any faulty assumptions here? I'm not getting this result in practice and am not sure where I'm going wrong.
 A: [Turning my comment into an answer.]
The problem is that $\vec x\cdot\vec x'=\vec v\cdot\vec w$ is only true when $\vec x$ is coplanar with $\vec v$ and $\vec w$ (and the origin). If $\vec x$ is not in this plane, then the angle between it and its image after rotation will be less than the angle between $\vec p$ and $\vec q$. The extreme example of this is $\vec x=\vec u$ itself. Every rotation about $\vec u$ leaves it fixed, so the angle between $\vec x$ and $\vec x'$ is zero regardless of the rotation angle.  
The reason for this is that a rotation acts only on the component of a vector that’s orthogonal to the rotation axis, i.e., on its projection onto a plane perpendicular to $\vec u$. Imagine a unit sphere with $\vec u$ as the north pole. $\vec v$ and $\vec w$ are then on its equator and the angle between them is the difference in their longitudes. For any other unit vector $\vec x$, the angle between the projections of $\vec x$ and $\vec x'$ onto the equatorial plane is indeed equal to the rotation angle—this again the difference in longitudes—but the angle between $\vec x$ and $\vec x'$ themselves is measured in the plane defined by them and the origin. The greater the latitude of $\vec x$, the smaller this true angle gets.
