# Help with transformation matrices involving multiple transformations

Transformations matrices have always been sort of a weak area for me just because it always feels like I'm doing the process wrong.

The question I'm trying to solve is this:

Suppose we stretch the picture horizontally by a factor of 2, rotate it 45 degrees clockwise, shrink it horizontally by a factor of 3 and then reflect it through the y-axis

My attempt at the question:

The first step's matrix would be: $$\begin{bmatrix}2&0\\0&1\end{bmatrix}$$

The second step's matrix would be: $$\begin{bmatrix}\cos(-\pi/4)&-\sin(-\pi/4)\\\sin(-\pi/4)&\cos(-\pi/4)\end{bmatrix}$$

The third step's matrix would be: $$\begin{bmatrix}1/3&0\\0&1\end{bmatrix}$$

The last step's matrix would be: $$\begin{bmatrix}-1&0\\0&1\end{bmatrix}$$

I multiplied all the transformation matrices together in the order given and got a final answer of approximately: $$\begin{bmatrix}-0.4714&1.4142\\0.2357&0.7071\end{bmatrix}$$

I just want to make sure what I did was correct. If I made an error somewhere in the middle, please let me know. I cannot understand transformation matrices for the life of me :(

• If the transforms as listed are A, B, C, D then you want DCBA. Your matrices look fine but I don't get the same final product as you
– Paul
Feb 21 '20 at 9:56
• May I ask what you mean by "you want DCBA"? Feb 21 '20 at 16:57
• You multiply in that order, not ABCD. The first transformation is on the right, not the left.
– Paul
Feb 21 '20 at 19:15

Have you heard of 3blue1brown? That YouTube channel is the only reason I understood linear algebra and more.

Basically all you do is follow where the basis vectors go. Very smoothly and patiently, you will get an answer.

But if you want to confirm your math homework answers very quickly you could try this Desmos feature I dug up.

https://www.desmos.com/matrix

I won't compute the actual thing here cause Latex is stressful on a phone. But if this down here is what you worked out, then you'll be fine(matrix multiplication is inside out like function composition):

$$\begin{bmatrix} -1 & 0\\ 0 & 1 \end{bmatrix} \begin{bmatrix} \frac{1}{3} & 0\\ 0 & 1 \end{bmatrix} \begin{bmatrix} \frac{\sqrt{2}}{2} & \frac{\sqrt{2}}{2}\\ -\frac{\sqrt{2}}{2} & \frac{\sqrt{2}}{2} \end{bmatrix} \begin{bmatrix} 2 & 0\\ 0 & 1 \end{bmatrix}$$

Don't despair so easily. With enough practice, patience and intuition in something especially sweet like linear algebra you will get better at math.

Edit: I'm not sure how you did the multiplication cause I got:

$$\begin{bmatrix} -\frac{\sqrt{2}}{3} & -\frac{\sqrt{2}}{6}\\ -\sqrt{2} & \frac{\sqrt{2}}{2} \end{bmatrix}$$

• How did you get one of your matrices as sqrt2/2? Why is it not 1/sqrt2? Feb 21 '20 at 16:57
• Oh it's the same thing. Influence of my Physics teacher. That's how I always write it. But to be clear $\frac{1}{\sqrt{2}} \cdot \frac{\sqrt{2}}{\sqrt{2}}=\frac{\sqrt{2}}{2}$ Feb 21 '20 at 17:00
• Ah I see. That makes sense. So is it that my matrices were correct but my multiplication was done wrong? Is it right that the multiplication is step1 * step2 * step3* step4? Feb 21 '20 at 17:06
• Yes. If the picture was operated on like that, you have to take it as it is. But I really recommend you check out those links. By just following $\hat \imath, \hat \jmath$ I was able to do it in 3 minutes only. Feb 21 '20 at 17:13
• Sounds good thank you for your help Feb 21 '20 at 17:14