0

Let's say I have two rotations matrices (in 3D) $R_1$ and $R_2$, as well as two scaling (of the form $\text{diag}(s_x,s_y,s_z)$) matrices $S_1$ and $S_2$. Then, I can define two spatial transformations $T_1 = R_1S_1$ and $T_2 = R_2S_2$.

Now, let $T=T_2T_1$. As a composition of spatial transformations, $T$ is still a spatial transformation. However, it is not clear to me if $T$ can in turn be decomposed as $T=RS$, with some rotation $R$ and some scaling $S$.

I am aware of this question and answer, but my question is not "how can I decompose $T$" but rather "can $T$ still be decomposed" ? Obviously, if $T$ cannot be decomposed, there is no point in searching $R$ and $S$ - for example, if there are not unique. If it can, then I know how to do it by using the link above - assuming the answer there is correct.

  • Does “scaling matrix” mean “diagonal matrix” to you? At first I thought you might mean a matrix of the form $kI_n$ where $k$ is a scalar, but that’s not what the linked question does. – rschwieb Mar 26 '20 at 10:58
  • 1
    I edited the question to answer. I mean a diagonal matrix with different values $s_x, s_y, s_z$. – Florian Ingels Mar 26 '20 at 11:00

1 Answers1

2

This isn’t even generally possible in 2D. Take, for example, $S_1=I$, $S_2=\operatorname{diag}(2,1)$ and two 45-degree rotations. We then have $$T = \begin{bmatrix}\frac1{\sqrt2}&-\frac1{\sqrt2}\\\frac1{\sqrt2}&\frac1{\sqrt2}\end{bmatrix} \begin{bmatrix}2&0\\0&1\end{bmatrix} \begin{bmatrix}\frac1{\sqrt2}&-\frac1{\sqrt2}\\\frac1{\sqrt2}&\frac1{\sqrt2}\end{bmatrix} = \begin{bmatrix}\frac12&-\frac32\\\frac32&-\frac12\end{bmatrix}.$$ Now, suppose that this can be decomposed into a scaling along the coordinate axes followed by a rotation. Then there’s some diagonal matrix $D$ such that $TD$ is orthogonal. Setting $D=\operatorname{diag}(a,b)$, this means that we must have $$\begin{bmatrix}\frac12a&\frac32a\\-\frac32b&-\frac12b\end{bmatrix}\begin{bmatrix}\frac12a&-\frac32b\\\frac32a&-\frac12b\end{bmatrix} = \begin{bmatrix}\frac52a^2&-\frac32ab\\-\frac32ab&\frac52b^2\end{bmatrix} = I.$$ There is obviously no solution to this equation.

You do have the polar decomposition available, which lets you decompose $T$ into a scaling along some set of orthogonal directions followed by a rotation, but there’s no guarantee that those scaling directions will coincide with the coordinate axes, as demonstrated above. For that example, we can write $$T = \begin{bmatrix}0&-1\\1&0\end{bmatrix} \begin{bmatrix}\frac32&-\frac12\\-\frac12&\frac32\end{bmatrix}.$$ The right-hand matrix scales by a factor of $2$ in the direction of $(1,-1)$ and by a factor of $1$ in the direction of $(1,1)$, as you can verify by computing eigenvalues and eigenvectors, while the left-hand matrix is a 90-degree rotation.

amd
  • 53,693
  • Thank you for the very clear answer. Would you say that the scaling directions do not match the coordinate axes comes from the fact that $S_2$ is applied after a first rotation, therefore applied to axes that are not the coordinates ones ? – Florian Ingels Mar 26 '20 at 21:24
  • @FlorianIngels That’s what my gut instinct tells me. – amd Mar 26 '20 at 21:36
  • It would make sense. Thank you again ! – Florian Ingels Mar 27 '20 at 08:48