7

When I have a linear map

$$ A = \pmatrix{a & b \\ c &d} $$

It obviously has 4 degrees of freedom. I would now like to decompose it into scale, rotation and sheer components:

$$ A = BCD = \pmatrix{s_1 & 0 \\ 0 & s_2}\pmatrix{\cos \alpha & -\sin \alpha \\ \sin \alpha & \cos \alpha} \pmatrix{1 & s_3 \\ s_4 & 1} $$

Or a similar decomposition. My problem here is, that I know have 5 degrees of freedom, so at least one variable must be a function of the others.

I suspect that there $BC$ isn't uniquely defined this way and shear can be expressed in one dimension combined with the correct rotation, but I do not know what's the actual decomposition I am looking for.

Some resources on shear maps suggest that your define horizontal $s_4=0$ or vertical ($s_3=0$) shear maps, so it is area preserving. But my map $A$ is a general transformation between two arbitrary (non-degenerate) triangles, so there are no such constraints and most transformations will need a non-area-preserving term.

allo
  • 231
  • 1
    I think that the decomposition you are looking for is not unique. since with a scaling and a sheer you can make a rotation – 1123581321 Sep 04 '18 at 08:07
  • 1
    If the matrix is square, eigen-decomposition can provide rotation and scaling matrices. For a non-square matrix, SVD can provide the rotation and scaling. I don't know how to get the shear matrix. – user146290 Sep 04 '18 at 08:16
  • I already thought about this. As far as I understand this, the SVD is more or less: rotate into a reference coordinate system, rescale, rotate back, see eg. https://de.wikipedia.org/wiki/Datei:Singular-Value-Decomposition.svg in Wikipedia. But this seems not to separate scaling and shearing, as S is a scaling matrix in another coordinate system. – allo Sep 04 '18 at 08:32
  • 1
    The scaling ($B$) component provides all of the area scaling that you might need. – amd Sep 04 '18 at 09:31
  • 1
    I don’t know of any particularly clean way to compute such a decomposition, if it exists. You could certainly expand the matrix product and then solve for the various parameters, but the resulting expressions are quite unwieldy, and I’m not sure that there are real solutions for all real matrices. On the other hand, if you’re willing to put the rotation either first or last in the sequence, then you can start from a $QR$ or polar decomposition and break down the upper-triangular or PSD matrix further. – amd Sep 07 '18 at 06:12
  • The polar decomposition is probably related, I already tried to use it as starting point. The point with the form I tried to get is the too high rank, which requires reduction for an unique decomposition and the question is if after removing one variable there is a decomposition left, which separates the operations in a nice way. – allo Sep 07 '18 at 08:33
  • Currently I went with using this redundant form, as my application is ptimization and when I hold two matrices fixed and optimize the third, the current decomposition may work for this purpose. I left the question open, as someone still may post a non-redundant decomposition or a good explanation how to define one of the variables as function of the others, which would be interesting for the general question as I posted it. – allo Sep 07 '18 at 08:36
  • Can someone help with the answer using the polar decomposition? I think a unitary matrix only describes a rotation and reflections. Here there can only be 1 reflection as it would otherwise be a rotation. I suspect that positive semi-definite means that P cannot contain a reflection, but I don't want to add something wrong to the answer. If I am correct, then a unitary matrix has one degree of freedom in the rotation and the sign of the scaling. The four entries in the positive semi-definite matrix P would be the other degrees of freedom minus the sign that is contained in U. – allo Aug 24 '22 at 21:09

2 Answers2

1

A transformation which is a combination of scaling, rotation, shear, and translation is affine and conserves the parallelism. Your case is a special case where the translation is null. You can eliminate one parameter by applying the conservation of parallelism.

Shaktyai
  • 141
  • I actually even want to parameterize an affine transformation, but I use it already in the Form $A+t$, so I just need to decompose $A$. Can you elaborate on what matrices you construct for the conservation of parallelism you're mentioning? – allo Sep 04 '18 at 09:21
  • u(a,b)//v(c,d) <=> det(u,v)=0 Apply the mapping to both u and v and check the images u',v' are still parallel – Shaktyai Sep 04 '18 at 16:32
0

I think the Polar Decomposition is what I was looking for.

$A=UP$ is a decomposition in a unitary matrix $U$ and a positive semi-definite hermitian matrix $P$, in which $U$ describes rotation or reflection and $P$ scaling and shearing.

It can be calculated using the SVD $W\Sigma V^*$ by

$$ U = V \Sigma V^* \\ P = W V^* $$

I think if necessary, one can then further decompose $U$ into a scale and a shear matrix by finding the scale matrix $S$ such that all diagonal entries of the shear matrix $S^{-1}U$ are $1$.

The number of degrees of freedom can be explained by the properties of the matrices, e.g. the rotation matrix has the constraint of being unitary and having $\alpha\in[0;2\pi)$ (with other values being equivalent to values in this range), which limits its degree of freedom.

allo
  • 231