Affine Linear Transformations
There can be a bit of confusion about what a "linear function" is. On one hand,
$$
y=a+bx\tag{1}
$$
describes a line, and is often called a linear function.
On the other hand, a function between vector spaces defined by matrix multiplication
$$
y=Mx\tag{2}
$$
is also called a linear transformation.
There are also functions called Affine Linear Transformations, which combine these two notions. They are compositions of a linear transformation and a translation.
$$
\begin{bmatrix}
r\\
s
\end{bmatrix}
=
\begin{bmatrix}
a&b\\
c&d
\end{bmatrix}
\begin{bmatrix}
x\\
y
\end{bmatrix}
+
\begin{bmatrix}
h\\
k
\end{bmatrix}\tag{3}
$$
An affine transformation in $\mathbb{R}^2$ can be viewed as a linear transformation on a plane in $\mathbb{R}^3$.
For example, on the plane $z=1$ in $\mathbb{R}^3$, the linear transformation
$$
\begin{bmatrix}
r\\
s\\
1
\end{bmatrix}
=
\begin{bmatrix}
a&b&h\\
c&d&k\\
0&0&1
\end{bmatrix}
\begin{bmatrix}
x\\
y\\
1
\end{bmatrix}\tag{4}
$$
has the same effect as the affine transformation in $(3)$.
This is often how affine transformations are performed in computer graphics.
Perspective Transformations
The preceding approach can be generalized to perspective transformations by replacing the two zeros in the bottom row of the matrix in $(4)$ with non-zero numbers and by using the perspective projection between $\mathbb{R}^2$ and $\mathbb{R}^3$:
$$
\begin{bmatrix}
x\\
y
\end{bmatrix}
\to
\begin{bmatrix}
x\\
y\\
1
\end{bmatrix}
\quad\text{and}\quad
\begin{bmatrix}
x\\
y\\
z
\end{bmatrix}
\to
\begin{bmatrix}
x/z\\
y/z
\end{bmatrix}\tag{5}
$$
That is,
$$
\begin{bmatrix}
x\\
y
\end{bmatrix}
\to
\begin{bmatrix}
r\\
s\\
t
\end{bmatrix}
=
\begin{bmatrix}
a&b&h\\
c&d&k\\
u&v&1
\end{bmatrix}
\begin{bmatrix}
x\\
y\\
1
\end{bmatrix}
\to
\begin{bmatrix}
r/t\\
s/t
\end{bmatrix}\tag{6}
$$