2
$\begingroup$

I have two coordinate systems (xyz and x'y'z') and I need to find the angle of rotation between the two of them. xyz is fixed and x'y'z' starts in the same position as xyz. x'y'z' is then rotated 45 degrees about the y' axis and then rotated 30 degrees about the z' axis.

After the first rotation it's not bad since y and y' are still inline, but when the second rotation is made I get completely lost. Is there some trick for figuring out something like this? Thanks

Update:

I'll try to expand on what I'm asking for since some of the comments posed good questions. Also what I'm trying to do is take some 3D CAD into a simulation software and I need the relation between the mounting point and the end of the tool, which is rotated in two directions. I can't figure a way to measure this in my CAD world or I wouldn't be here.

I would like the x, y, and z angles between the two coordinate systems. Below are some pictures showing what I'm trying to do and hopefully it'll help.

The first picture is where x'y'z' (shown) is the same as xyz. The second picture is the 45° rotation about y' and the last picture shows the 30° rotation about z'.

I can move the coordinate system in my simulation program around and I get the values 26.733° about x, 37.653° about y, and 39.505° about z. Those values should be really close, but I cannot manually move that UCS exactly where it needs to be.

Starting pointRotation about y'Rotation about z'

$\endgroup$
  • $\begingroup$ Have a look at en.wikipedia.org/wiki/Rotation_matrix#In_three_dimensions $\endgroup$ – ITA Jul 25 '16 at 15:50
  • $\begingroup$ So you are looking for a single angle that represents your rotation? If so, you can convert your rotation into an axis-angle rotation. Ivan's link actually discusses the conversion. $\endgroup$ – Carser Jul 25 '16 at 16:04
1
$\begingroup$

Hint:

The matrix that represents the first rotation is: $$R_1= \begin{bmatrix} \frac{\sqrt{2}}{2}&0&\frac{\sqrt{2}}{2}\\ 0&1&0\\ -\frac{\sqrt{2}}{2}&0&\frac{\sqrt{2}}{2} \end{bmatrix} $$ applying it to the unit vector $\vec k=[0,0,1]^T$ that orients the $z$ axis you find the unit vector that orients the axis $z'$: $$ \vec {k'}=R_1 \vec k=[u_1,u_2,u_3]^T $$ Now you have a second rotation $R_2$ around this axis by an angle $\theta=30°$ that can be represented by a mtrix as you can see here.

So, starting from a vector $\vec v=[x,y,z]^T$ you can find the vector $\vec {v'}=R_2(R_1\vec v)$ and find the angle $\alpha$ between them using the inner product: $$ \vec v \cdot \vec{v'}=|\vec{v}||\vec{v'}|\cos \alpha $$

$\endgroup$
1
$\begingroup$

I am not sure what you mean by angle of rotation. In general rotations in 3D are given by set of angles - Euler Angles or as an axis and angle. In your case, you can generate the rotation matrix as

$R = {R_y}\left( {\frac{\pi }{4}} \right){R_y}\left( {\frac{\pi }{6}} \right)$

using notation from the this page. Note that the assumption here is you want to work with local coordinates (in basis $x' y' x'$), otherwise the matrices need to be pre-multiplied when using global coordinates (in basis $x y z$). Then you can use the log map from $SO(3) \to so(3)$ to determine the axis and angle representation.

$\theta = \arccos \left( {\frac{{tr\left( R \right) - 1}}{2}} \right) $ and $ l = \frac{1}{{2\sin \left( \theta \right)}}\left[ {\begin{array}{*{20}{c}} {R\left( {3,2} \right) - R\left( {2,3} \right)} \\ {R\left( {1,3} \right) - R\left( {3,1} \right)} \\ {R\left( {2,1} \right) - R\left( {1,2} \right)} \end{array}} \right]$

More information can be found here.

EDIT: After the edit to the question with the pictures, I believe what you want to do is take the unit basis vectors $e_1, e_2, e_3$, rotate them via the rotation matrix, to get $e_1', e_2', e_3'$ and then find the angle between $e_1$ & $e_1'$, $e_2$ & $e_2'$ and $e_3$ & $e_3'$ using the inner product as Emilio suggested.

$\endgroup$

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.