# Remove scale transformation from a complex transform matrix $4\times 4$

My common task is I have a rect with coordinates of its $2$ points: $(x, y, z), (x + a, y + b, z)$. I applied a $4\times4$ transform matrix to it and it became a quadrilateral. Now for some reasons I can't use it this way and must apply scaling before other transformations. The list of operations is given below (it is used in computer graphics so I don't know exactly if it is a correct order or if it should be reversed). How to solve this issue?

1. perspective (m34 = -0.0001);
2. translation by z = -radius;
3. rotation around x axis;
4. rotation around y axis;
5. scale (decrease the size);
6. translation by z = radius.

This $4\times4$ matrix is transposed (for example, m41 means translation by x, m42 translation by y and m43 translation by z).