👉 The math behind a simple geometric transformation, like scaling an image, involves linear algebra. When you scale an image by a factor \( k \) in both the x and y directions, each pixel's new coordinates are calculated as \( (kx, ky) \), where \( (x, y) \) are the original coordinates and \( (kx, ky) \) are the transformed ones. This transformation is represented by a 2x2 matrix: \[ \begin{pmatrix} k & 0 \\ 0 & k \end{pmatrix} \] Multiplying this matrix by a pixel's coordinate vector \( \begin{pmatrix} x \\ y \end{pmatrix} \) results in the new coordinates \( \begin{pmatrix} kx \\ ky \end{pmatrix} \), effectively stretching or shrinking the image uniformly in both dimensions. This matrix operation encapsulates the essence of linear transformations, demonstrating how basic principles of vector mathematics can be applied to manipulate images in computer graphics.