Extracting Rotation from a Scaling and Rotation Matrix

  • Thread starter Thread starter makc
  • Start date Start date
  • Tags Tags
    Matrix
AI Thread Summary
The discussion focuses on extracting the rotation component from a matrix that scales and rotates 3D vectors. Participants suggest that the scaling matrix should be diagonal, while the rotation matrix is orthogonal with a determinant of 1. They explore methods like QR decomposition to isolate the rotation part and discuss the mathematical relationships between the matrices involved. Some confusion arises regarding specific coefficients and the derivation of certain values, but one participant notes that if the scaling matrix is a multiple of the identity, the problem simplifies significantly. Overall, the conversation highlights the complexity of matrix decomposition in 3D transformations.
makc
Messages
65
Reaction score
0

Homework Statement


We have (3d) vectors v1 and v2, and some matrix M, v2 = M v1. This scales and rotates vectors, but I need to constrain this to rotation only. So we have this in a form M = S * R (or R * S) where S is scaling only matrix, and R is rotation only.


Homework Equations


If I knew these, I wouldn't be posting.


The Attempt at a Solution


I figured that S must be diagonal matrix, and if we put ort vectors through M, we could somehow find its non-zero coefs and then easily invert it, but the exact math escapes me... Then I thought, there must be someone who did this, or knows someone who did :)

[edit] I have found this unfinished discussion on gamedev, that suggests this thing is implemented in directx, so it is definitely possible; meanwhile, I will keep searching.

[edit] holy crrr carramba, it seems so complex. 1 + 2 and 3... my head is going to explode.

is there at least any simple way to extract rotation part alone?
 
Last edited:
Physics news on Phys.org
I'm not sure that such a decomposition exists in the general case.

You should look into the QR decomposition algorithms.
 
hey thanks I looked at this method, and it seems to solve my problem in just three steps. however, I do not understand whre they got 6 in denominator from.

I also looked at this article, and the notes there seem to be saying that I can compute G coefs immediately, without finding an angle. but there I can't seem to grasp where do they get a and b from.

:(
 
There's always Numerical Recipes, http://www.nrbook.com/a/bookcpdf/c2-10.pdf

Beware that the code is in "C-Tran" (Fortran translated to C). In particular, arrays are indexed from 1 (ala Fortran) rather than 0, as in C.
 
thanks, but that pdf doesn't open here. I seem to figure that a and b refer to values in original matrix, so I will try to code this per wiki (hopefully people who wrote that did not screw it up).
 
Last edited:
makc said:

Homework Statement


We have (3d) vectors v1 and v2, and some matrix M, v2 = M v1. This scales and rotates vectors, but I need to constrain this to rotation only. So we have this in a form M = S * R (or R * S) where S is scaling only matrix, and R is rotation only.
Just to clarify...

S is supposed to be a diagonal matrix?
R is supposed to be an orthogonal matrix with determinant 1?

If so, this is appears to be a very easy problem:

If M = RS, then

M^T M = S^T R^T R S = S I S = S^2

If M = SR, then

M M^T = S R R^T S^T = S I S = S^2

Either way, you can cancel out the rotation and thus get the square of your scaling matrix. All that's left is to take the square root, and guess the signs.

If R is allowed to be a combination of rotations and reflections, then it doesn't even matter if you get the signs right!


If S is supposed to be a multiple of the identity, it's even easier: SR=RS, and you only need to compute a single entry of M^T M.
 
Last edited:
I picked up this problem from the Schaum's series book titled "College Mathematics" by Ayres/Schmidt. It is a solved problem in the book. But what surprised me was that the solution to this problem was given in one line without any explanation. I could, therefore, not understand how the given one-line solution was reached. The one-line solution in the book says: The equation is ##x \cos{\omega} +y \sin{\omega} - 5 = 0##, ##\omega## being the parameter. From my side, the only thing I could...
Back
Top