# Given this transformation matrix, how do I decompose it into translation, rotation and scale matrices?

I have this problem from my Graphics course. Given this transformation matrix:

I need to extract translation, rotation and scale matrices.
I’ve also have the answer (which is $TRS$):

I just have no idea (except for the Translation matrix) how I would get to this solution.

I am a person from the future, and I had the same problem. For future reference, here’s the algorithm for 4×4. You can solve your 3×3 problem by padding out your problem to the larger dimensions.

1. Extract Translation
This is basically the last column of the matrix:While you’re at it, zero them in the matrix.

2. Extract Scale
For this, take the length of the first three column vectors:

3. Extract Rotation
Divide the first three column vectors by the scaling factors you just found. Your matrix should now look like this (remember we zeroed the translation):This is the rotation matrix. There are methods to convert it to quaternions, and from there to axis-angle, if you want either of those instead.

resource