Then we can transform the square by combining the vertices into a matrix (denoted by $A$), and multiply it by the transformation matrix $T$. In other words,

And $TA$ is the transformed square.

Of course, this idea can also apply to other shapes other than squares.