# Finding rotation matrix with given new and old frame

1. Aug 3, 2011

### faribataghavi

Hi,

I have a rotated frame (new matrix, T(x,y, z)) and the original frame (old matrix T(X,Y,Z)). I want to use this formula to find the Rotation matrix:

T(x,y, z) = R-1 T(X,Y,Z) R

Is this eqation right? how can I calculate R (rotation matrix) in ZYZ order in this equation?

Thank You

2. Aug 3, 2011

### Rasalhague

Let $v$ be the components of a vector $\mathbf{v}$ with respect to your old basis (frame). Let $v'$, "v prime", be the components of $\mathbf{v}$ with respect to your new basis. If the old and new components are related by

$$v'=Av,$$

then, in particular, the components of the vectors of the old basis, written as columns of a matrix, $B$, are related to their own representations, with respect to the new basis, $B'$, by $B'=AB,$, so that $A^{-1}B'=B$. But the components of any basis vectors, with respect to themselves, comprise the identity matrix! So $A^{-1}B'=I$, and so $B'=A$. The components of your new basis, with respect to the old, are $A^{-1}$, since $A^{-1}v'=Iv=v$.

(Note also: It's a property of rotation matrices that $R^{-1}=R^T$, where $R^T$ means the transpose of $R$.)

I'm not sure if the following is what you meant: but if the columns of T(x,y,z) contain the components of your new basis vectors, with respect to themselves, and T(X,Y,Z) the components of your old basis, with respect to themselves, then, and your R is my A, then your equation is correct, and says

$$I=R^{-1}IR=R^{-1}R.$$

I didn't understand you final question.

3. Aug 3, 2011

### faribataghavi

T(x,y, z) and T(X,Y,Z) in the new and old axes frame respectively.

More generally, my second question is that if I have two matrixes (old and new), how can I calculate the rotation matrix between these two matrices?

I have to mention that this rotation matrix should be a representation of successive rotation around z, y and again z axes.

I know that this rotation matrix should have a form like what is here:

http://en.wikipedia.org/wiki/Euler_angles#Matrix_orientation (jump to: Relationship to other representations and look at ZYZ rotation matrix orientation)

but I do know how to find if from given old and new matrix.

Thanks again

4. Aug 4, 2011

### Rasalhague

Sorry I haven't been much help to you. Your question is more complicated than I thought it was. Hopefully someone else can enlighten us.

Do you want the rotation matrix expressed as a composition of intrinsic rotations? I think this Wikipedia article uses a slightly different notation from you: (x,y,z) for the initial frame, and (X,Y,Z) for the moving frame. Regarding your formula, let $A_{i1}$ be the components of the 1st basis vector of the initial frame, and $B_{i1}$ the components of the first basis vector of the final frame, both with respect to some arbitrary frame.

$$\sum_{i=1}^{3}R_{ki}A_{i1}=B_{k1},$$

and similarly for $A_{i2}$ and $A_{i3}$. Let the $j$th column of matrices $A$ and $B$ denote the components of the $j$th basis vector of your initial and final frames respectively. Then $RA=B$, so $R=BA^{-1}$ doesn't it? Or am I missing something? I think you're saying that T(x,y,z) is such a matrix, whose columns are the basis vectors of your final frame, while T(X,Y,Z) is the corresponding matrix for your initial frame.

There's a subsection here called Intermediate frames which explicitly relates the basis vectors of initial and final frames via the intermediate frames. I think this refers to the ZYZ composition of intrinsic rotations convention. Could we get the Euler angles from here?

There's a lot a discussion of these sorts of questions on the internet, but it isn't always easy to know what conventions people are using.

Last edited: Aug 4, 2011