Rotation Matrix

Started by
2 comments, last by evil_ash 21 years, 2 months ago
Can someone explain how to find the nearest rotation matrix for a given 3x3 matrix.
Advertisement
what ??

a 3x3 matrix IS a rotation matrix !

what is this question ? I dont understand..
the nearest Correct matrix(as in it has rotation matrix properties - like its tranpose is its inverse)
Look up the "Gram Schmidt algorithm" for orthonormalising any basis. Treat the rows (or the columns) as the basis vectors. The order in which you pick the first base vector will affect the final outcome though, the first one is unchanged (except that is normalised). You could calculate all possible bases produced by the algorithm, you''d have to do it 6 times though (once for each ordering of the input base vectors). Then pick the matrix which, when subtracted from the original, has least (modulus of the) determinant, i.e. min(abs(det( B_out - B_in ))).

Any orthonormal basis has the properties you describe (transpose is it''s inverse). You may need to check that the final matrix has determinant +1 rather than -1 though, otherwise you get a reflection as well (so you need to reverse one of the output base vectors).

"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley
"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley

This topic is closed to new replies.

Advertisement