Extracting Rotation from a Scaling and Rotation Matrix

  • Thread starter Thread starter makc
  • Start date Start date
  • Tags Tags
    Matrix
Click For Summary

Homework Help Overview

The discussion revolves around the decomposition of a transformation matrix M that scales and rotates 3D vectors. The original poster seeks to isolate the rotation component from the combined scaling and rotation effects represented by the matrix M.

Discussion Character

  • Exploratory, Assumption checking, Mathematical reasoning

Approaches and Questions Raised

  • The original poster considers the structure of matrix M and suggests that it can be expressed as a product of a scaling matrix S and a rotation matrix R. They explore the properties of these matrices, questioning how to extract R from M.
  • Some participants suggest looking into QR decomposition as a potential method for achieving the desired separation.
  • There are inquiries about specific coefficients and terms in the equations, indicating confusion about the derivation of certain values.
  • One participant discusses the implications of R being orthogonal and the conditions under which the decomposition might simplify.

Discussion Status

The discussion is ongoing, with various methods being explored. Some participants have provided references to algorithms and resources that may assist in the decomposition process. However, there is no consensus on a single method, and participants continue to seek clarification on specific mathematical details.

Contextual Notes

Participants are grappling with the complexity of the problem, noting the challenges in deriving the necessary components from the transformation matrix. There are indications of missing information and assumptions about the properties of the matrices involved.

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

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

Similar threads

Replies
3
Views
2K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 7 ·
Replies
7
Views
3K
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K