I am trying to decompose affine transformations in elementary operations (rotation, scaling, shear), leaving translation aside for the moment, and in particular, to understand the relation of affine transformations with the singular value decomposition (SVD). I am focusing on the two dimensional case.
$$M = U \Sigma V^t$$
There are already a number of questions asking about this, none of them with a general, definitive answer:
- Decomposing an Affine transformation (non-general answer, only specific chain of operations)
- extracting rotation, scale values from 2d transformation matrix (non-definitive answer, see discussion)
- Given this transformation matrix, how do I decompose it into translation, rotation and scale matrices? (does not explain how to pad the problem to 4 dimensions, incorrect in the presence of shear, see discussion)
- Why can any affine transformaton be constructed from a sequence of rotations, translations, and scalings? (accepted answer omits the explanation about singular value decomposition, second answer mentions "trivial" details that have to be polished but does not address them)
In particular, I observed, but could not prove, that
- The singular values of an affine transformation matrix are the absolute values of the scaling parameters.
- The SVD of a transformation consisting in a uniform scaling and a proper rotation didn't reconstruct the original matrices, but introduced two improper rotations (i.e., determinant = -1).
- Nonetheless, the multiplication of these two improper rotations yielded the original rotation. Perhaps because the transformation is conformal?
In Python code:
In [66]: rot
Out[66]:
array([[ 0.8660254, -0.5 ],
[ 0.5 , 0.8660254]])
In [67]: sc
Out[67]:
array([[ 2., 0.],
[ 0., 2.]])
In [68]: svd(rot @ sc)
Out[68]:
(array([[-0.8660254, -0.5 ],
[-0.5 , 0.8660254]]), array([ 2., 2.]), array([[-1., -0.],
[ 0., 1.]]))
In [69]: det(_68[0])
Out[69]: -1.0000000000000002
In [70]: _68[0] @ _68[2]
Out[70]:
array([[ 0.8660254, -0.5 ],
[ 0.5 , 0.8660254]])
Under which assumptions can we perform this decomposition or does it make sense? Is there any proof that the singular values are the sorted absolute scaling factors? Is there a decomposition that is robust against reflection (i.e. improper transformations)?