Extracting Rotation from a Scaling and Rotation Matrix

  • Thread starter makc
  • Start date
  • Tags
    Matrix
In summary, to constrain a matrix M that scales and rotates vectors to rotation only, it can be expressed as M = S * R (or R * S) where S is a diagonal matrix and R is an orthogonal matrix with determinant 1. This can be solved by calculating M^T M or M M^T and taking the square root to find the scaling matrix S. If R is a combination of rotations and reflections, the signs do not matter. If S is a multiple of the identity, only one entry of M^T M needs to be computed.
  • #1
makc
65
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
  • #2
I'm not sure that such a decomposition exists in the general case.

You should look into the QR decomposition algorithms.
 
  • #3
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.

:(
 
  • #5
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:
  • #6
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:

1. How can we un-scale the matrix?

The process of un-scaling a matrix involves reversing the scaling operation that was applied to the original matrix. This can be done by multiplying each element of the scaled matrix by the inverse of the scaling factor.

2. Why do we need to un-scale a matrix?

Un-scaling a matrix can be useful in certain situations, such as when we want to retrieve the original data values from a scaled matrix or when we want to perform calculations on a matrix without the influence of the scaling factor.

3. What are the steps involved in un-scaling a matrix?

The steps for un-scaling a matrix are as follows:

  1. Determine the scaling factor that was applied to the original matrix.
  2. Calculate the inverse of the scaling factor.
  3. Multiply each element of the scaled matrix by the inverse of the scaling factor.

4. Can any matrix be un-scaled?

Not all matrices can be un-scaled, as the inverse of the scaling factor may not exist. This is the case when the scaling factor is equal to 0 or when the matrix is singular. In these cases, the original data cannot be retrieved.

5. Are there any limitations to un-scaling a matrix?

One limitation of un-scaling a matrix is that it only works for linear scaling operations. If the original matrix was scaled using a non-linear operation, the results of un-scaling may not be accurate. Additionally, if the scaling factor is not known or is imprecise, the un-scaled matrix may not perfectly match the original data.

Similar threads

  • Precalculus Mathematics Homework Help
Replies
3
Views
2K
  • Mechanics
Replies
2
Views
784
  • Precalculus Mathematics Homework Help
Replies
4
Views
1K
  • Mechanics
Replies
1
Views
1K
  • Linear and Abstract Algebra
Replies
2
Views
2K
  • Precalculus Mathematics Homework Help
Replies
3
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
2K
Replies
6
Views
1K
Replies
7
Views
861
Back
Top