# How to compute the rotation matrix

1. Feb 24, 2012

### Renoald

Hai , I have two matrix , let say X=[ A1 A2 A3
A4 A5 A5
A7 A8 A9
A10 A11 A12]
and X0=[B1 B2 B3
B4 B5 B6
B7 B8 B9
B10 B11 B12]

Can any one show me how to compute the rotation matrix from X and X0 ?
Thank You

2. Feb 25, 2012

### chiro

Hey Renoald and welcome to the forums.

One problem that you have is that a rotation matrix preserves the dimension and is a basis which means that the matrix has to be square (even if some values don't contribute in the form of zero entries).

I think it would be helpful if you gave the exact dimensions of your matrices for X and X0. If these are vectors in a Euclidean space, then this is a very well understood problem, but if they are matrices then we will need a more general result.

So lets say X is a matrix with 3 rows and 2 columns, X will be a 3x2 matrix.

3. Feb 25, 2012

### Renoald

Hai , Thank You for reply!
The dimension of X and X0 is 4 x 3 ( Matrix form) and This is not a square matrix.
Let Say X=RX0 , then the rotation matrix is R . How to compute the R ?
Thank You .......

4. Feb 25, 2012

### HallsofIvy

I am afraid you are going to have to explain what you mean by "rotating" one matrix to another.

5. Feb 26, 2012

### Hawkeye18

Hi Renoald.

In $\mathbb R^n$ the term "rotation" usually means an orthogonal matrix with the determinant 1 (the determinant of an orthogonal matrix is always 1 or -1).

So, as far as I understand your question is: given two $4\times 3$ matrices A and B find a rotation (an orthogonal matrix with determinant 1) R such that B=RA. And your matrices have real entries. Am I correct here?

Note that such R does not always exists: for 2 real matrices A and B one can find an orthogonal matrix R such that B=RA if and only if $A^T A =B^T B$, where $A^T$ is the transpose of A. So I assume your matrices satisfy this condition; if not, you are lucky, because such R does not exists, and you do not have to do anything :)

Probably the easiest way to find R is to apply Gram-Schmidt orthogonalization to the columns of one of the matrices (say A). If you know what it is, I can tell you what to do; if not, you have to learn it first.

6. Feb 27, 2012

### Renoald

Hai , thank you for the reply.
example i give here is what called as coordinate transformation.
I not sure Gram-Schmidt orthogonalization can used to resolve this problem or not !
as what i search by google , the solution given is Helmert transformation.

7. Feb 27, 2012

### Hawkeye18

Renoald,
if you want to get help, then STATE the problem first.

Am I correct, that translated to the mathematical language you problem can be stated like that:
given two 4×3 matrices A and B (with real entries) find a rotation (an orthogonal matrix with determinant 1) R such that B=RA?

If that is the statement, then the problem CAN be solved using Hilbert-Schmidt orthogonalization.

If that is not the statement, you should STATE the problem first: in particular, what do you mean by rotation in 4-dimensional space?