Extracting Rotation from a Scaling and Rotation Matrix

  • Thread starter Thread starter makc
  • Start date Start date
  • Tags Tags
    Matrix
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
5 replies · 4K views
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
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.

:(
 
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

[tex]M^T M = S^T R^T R S = S I S = S^2[/tex]

If M = SR, then

[tex]M M^T = S R R^T S^T = S I S = S^2[/tex]

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 [itex]M^T M[/itex].
 
Last edited: