Let's assume I have a start point A (x, y, z). Now the object has moved and the new orientation is given by a quaternion Q and it's pointing at point B which is L length away from it. How can I calculate the coordinates of point B(x, y, z).

You can assume that it doesn't move at all in a linear matter it just rotates. From my understanding you can get a direction from the quaternion. Now I am assuming that this a straight forward calculation. If it isn't can you point me in which direction I should look.

Apologizes in advances I am not a mathematician.


I'm not sure to well understand your question.

I start from the fact that, if we have two points $A$ and $B$, there are infinitely many rotations $R$ in $\mathbb{R}^3$ such that $R(A)=B$. In fact, for any point $P$ such that $\overline{PA}=\overline{PB}$, we can use as axis of the rotation the stright line $r$ from $P$, orthogonal to the plane that contains $A$,$B$ and $P$, and as angle of rotation the angle $\angle APB$.

So the problem is well defined only if we choose some point $P$ and, without loss of generality, we can assume that this point is the origin $O$ and $\overline{OA}=\overline{OB}$.

Now consider the vectors $\vec{a}=\vec{OA}=(x_A,y_A,z_A)^T$ and $\vec{b}=\vec{OB}=(x_B,y_B,z_B)^T$. The rotation that gives $\vec b$ from $\vec a$ is the rotation that has as axis the straight line that contain the vector $\vec w= \vec a \times \vec b$ (the cross product of the two vectors that is orthogonal the the plane containing these) and of angle $\theta=\arccos \left(\dfrac{\vec a \cdot \vec b}{|\vec a||\vec b|}\right)$ (with some care in the chose of $\theta$).

This rotation can be represented by means of quaternion. Let $$\vec u=(u_1,u_2,u_3)^T= \frac{\vec w}{|\vec w|}$$ the versor of the axis of rotation, than the rotation is given by: $$ \vec b = R_{\vec u, \theta}(\vec a)=e^{\frac{\theta}{2} \vec u}\,\vec a\, e^{-\frac{\theta}{2} \vec u} $$ where $$ e^{\frac{\theta}{2} \vec u}=\cos \left(\frac{\theta}{2} \right)+\vec u \sin\left(\frac{\theta}{2} \right)=\cos \left(\frac{\theta}{2} \right)+\left( u_1\mathbf i +u_2 \mathbf j +u_3 \mathbf k \right)\sin\left(\frac{\theta}{2} \right) $$ is a unitary quaternion. Note that the rotation is the same if we orient the versor in the opposite direction and we take the opposite of $\theta$.

Conversely, if we have a quaternion of the form $e^{\alpha \vec v}$ for some versor $\vec v$, than the product: $$ e^{\alpha \vec v}\,\vec a\, e^{-\alpha \vec v} $$ is the rotation of $\vec a$ around the axis $\vec v$ by an angle $2\alpha$.

I hope this can be helpful, and you can see my answer to Representing rotations using quaternions for other references.


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.