What is the closest rotation to a pure scaling? Intuitively, it should be the null rotation, the identity. One way to see this might be to consider starting with the identity scaling, for which it’s clearly true. If we then scale along one of the coordinate axes, there doesn’t seem to be any ‘torque’ that would change the closest rotation to some non-identity one. This will be true as we scale the remaining directions one at a time until we arrive at the initial scaling we were interested in.
It’s also easy to show this mathematically. Let the diagonal matrix $D$ contain our scalings, and let’s compare it to a rotation matrix $R$. We’re interested in minimizing the sum-of-squares difference between these two matrices. Now consider a row of $D – R$, say the first one. The sum-of-squares along this row is $$ (D_{11} – R_{11})^2 + \sum_{i=2}^N R_{1i}^2 = (D_{11} – R_{11})^2 + (1 – R_{11}^2) = D_{11}^2 + 1 – 2 D_{11} R_{11},$$ where the first equality is because the rows of $R$ have unit norm. Now this function is decreasing in $R_{11}$ when $D_{11}$ is positive, and increasing when $D_{11}$ is negative, and $R_{11} \in [-1,1]$, so $R_{11} = \text{sign}(D_{11})$. Applying the same reasoning to the remaining rows, we arrive at $$ \argmin_{R \in SO(N)} \|R – D\|_F^2 = \text{sign}(D).$$ This agrees with our intuition for positive scalings while also allowing for negative scalings by flipping along the coordinate axes.
Leave a Reply