Calculating the rotation angles between two vectors.

1.8k Views Asked by At

I have the two vectors $ V1 = \begin{pmatrix} 0.577 \\ 0.577 \\ 0.577 \end{pmatrix} $ and $ V2 = \begin{pmatrix} 0 \\ 0 \\ 1 \end{pmatrix} $

I need to find the rotation angles when rotating from V1 to V2 using Euler Angles - I must use the rotation matrix here:

R= $\begin{bmatrix} cos(\alpha)cos(\beta) & cos(\alpha)sin(\beta)sin(\gamma)-sin(\alpha)cos(\gamma) & cos(\alpha)sin(\beta)cos(\gamma)+sin(\alpha)sin(\gamma) \\ sin(\alpha)cos(\beta) & sin(\alpha)sin(\beta)sin(\gamma)+cos(\alpha)cos(\gamma) & sin(\alpha)sin(\beta)cos(\gamma)-cos(\alpha)sin(\gamma) \\ -sin(\beta) & cos(\beta)sin(\gamma) & cos(\beta)cos(\gamma) \end{bmatrix}$

I know how to find the angles given R eg. $ \alpha = Atan2(R_{23},R_{33}) $

So what i am essentially missing is solving the equation Ax=b, where i have x and b.

I know this will yield multiple solutions, i just need any.

Any help would be greatly appriciated.

1

There are 1 best solutions below

4
On

Like you mentioned, there can be many solutions. So one way is to find an axis and get the rotation angle around that. Suppose $V_1$ is not parallel to $V_2$. Then $V_1+V_2$ is along the bisector of the angle between them. Use this as rotation axis. The rotation of $V_1$ around this axis will describe a cone. When you rotate $180^\circ$ you get a vector along $V_2$. Now you can use the this formula to get the rotation matrix. Similarly, you can get an axis perpendicular to $V_1$ and $V_2$ by using the cross product. The angle of rotation is given by the scalar (dot) product of the vectors.

In case $V_1$ and $V_2$ are parallel, you can choose any vector in the perpendicular plane and rotate $180^\circ$.