Following recommendation of this answer I've recently read the series of articles of Wolfire about linear algebra. I'm somewhat familiar with matrices and I came to a conclusion that vector and matrix multiplication is in fact multiplication of 2x2 and 2x1 matrices:
\begin{equation*} \begin{bmatrix} a & c \\ b & d \end{bmatrix} \qquad \begin{bmatrix} x \\ y \end{bmatrix} \end{equation*}
In the article the author reveals that to accomplish translation in addition to rotation we need to add a row and a column to the translation matrix:
If we want to translate by a vector (e,f), we can just tack it onto our change-of-basis matrix like this: \begin{bmatrix} a & c & e\\ b & d & f\\ 0 & 0 & 1 \end{bmatrix} And then we add an extra 1 to the end of each position vector like this: \begin{bmatrix} x\\ y\\ 1 \end{bmatrix}
P.S. I edited the direction of the vector to make it comply with matrix multiplication conditions.
The 1 at the third row of the vector is totally understandable: to multiply 2x3 matrix we need a 3-row matrix.
What I didn't get here is why we need extra row for translation matrix? I can't see any difference in multiplication (except for the useless 1):
\begin{equation*} \begin{bmatrix} a & c & e\\ b & d & f\\ 0 & 0 & 1 \end{bmatrix} * \begin{bmatrix} x\\ y\\ 1 \end{bmatrix} = \begin{bmatrix} ax + cy + e\\ bx + dy + f\\ 0 + 0 + 1 \end{bmatrix} \end{equation*}
\begin{equation*} \begin{bmatrix} a & c & e\\ b & d & f\\ \end{bmatrix} * \begin{bmatrix} x\\ y\\ 1 \end{bmatrix} = \begin{bmatrix} ax + cy + e\\ bx + dy + f\\ \end{bmatrix} \end{equation*}
The same question goes for 3D matrices, just it's easier to convey with a 2D case