[Math] Writing a composite transformation as a matrix multiplication

matricestransformation

I am confused about a question on matrix multiplication of a transformation. I have two matrices, P and Q as follows:

$$P = \begin{pmatrix}\frac{1}{2} & \frac{\sqrt{3}}{2} \\ \frac{\sqrt{3}}{2} & -\frac{1}{2} \end{pmatrix}$$
$$Q = \begin{pmatrix}-\frac{1}{2} & \frac{\sqrt{3}}{2} \\ \frac{\sqrt{3}}{2} & \frac{1}{2} \end{pmatrix}$$

I am going through a question where I have to find the single transformation equivalent to transformation P followed by transformation Q. Now I know that the notation for transformations on a point p is go from right to left. Eg PQ(p) would mean apply transformation Q then apply transformation P. Is that correct?

Now the answer I need to get to is the result of multiplication matrices QP. So when you do matrix multiplication you always perform as opposite of transformation? Eg transformation PQ(p) above would be written in matrix multiplication form as QP?

It is a little confusing.

Best Answer

Matrices work like functions. If you have functions $f: A \to B$ and $g: B \to C$, and a element $x \in A$, we do first $f(x)$, then $g(f(x)) = (g \circ f)(x)$. Notice that the order is different, we applied $f$, then $g$, but the result ended up being $g \circ f$. It is the same for matrices.

Extra info. for you: The matrix of rotation by a angle $\theta$ is given by $$\begin{pmatrix} \cos \theta & - \sin \theta \\ \sin \theta & \cos \theta\end{pmatrix}$$ This way, $P$ is rotation by $60 \deg$ and $Q$ is rotation by $120 \deg$.