0
$\begingroup$

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.

$\endgroup$
1

1 Answer 1

2
$\begingroup$

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$.

$\endgroup$
4
  • $\begingroup$ I used your idea to rotate between the two vectors, and with the help from link i converted the axis angle to the euler angles i need. $\endgroup$ Oct 6, 2021 at 13:11
  • $\begingroup$ I forgot to add the following: Now, I want to expand on this solution so that V2 is a plane (normal vector) with the possibility to rotate other points onto that plane. But using only the normal vector will not give me a unique result, where all 3 axis are where i want them. Is it possible to rotate only once with the formula you gave me and end up with all 3 axis lined up in a way i define? $\endgroup$ Oct 6, 2021 at 13:19
  • $\begingroup$ Yes, it is possible, but you need more information. You want to rotate $v_1$ to $u_1$ (the normal) and $v_2$ to $u_2$ (a vector in the plane). You can get a third vector, also in the plane, $v_3$ and $u_3$ by using the cross product. Make a matrix $V$ with columns made out of $v_i$ and $U$ out of $u_i$. Then your rotation matrix transforms $V$ to $U$ by this formula: $RV=U$ or $R=UV^{-1}$. $\endgroup$
    – Andrei
    Oct 6, 2021 at 17:10
  • $\begingroup$ I used the formula to get R. Choosing a vector in one system and doing R*V1 gives me the vector in the other system - Thanks!. However, extracting the axis&angle from R, and then rotating the same V1 with that axis&angle, does not produce the same result. Is it only possible to extract axis and angle from R, if it satisfies [link] (en.wikipedia.org/wiki/…) How would I proceed to get the axis&angle from R, or the Euler Angles? Or if R needs to satisfy above, how would I produce R (given V&U) in a way where i can extract the angle. $\endgroup$ Oct 7, 2021 at 15:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .