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.