# Geometry - Scaling

Scaling is a transformation that is generally applied by the transformation matrix

## 3 - Matrix multiplication

The functional form $$x' = a.x \\ y' = d.y$$ becomes the following matrix. $$\begin{bmatrix} x' \\ y' \\ \end{bmatrix} = \begin{bmatrix} a & 0 \\ 0 & d \\ \end{bmatrix} \begin{bmatrix} x \\ y \\ \end{bmatrix}$$

Using the standard transformation matrix notation, it would become: $$\begin{bmatrix} x' \\ y' \\ 1 \end{bmatrix} = \begin{bmatrix} a & 0 & 0 \\ 0 & d & 0 \\ 0 & 0 & 0 \end{bmatrix} \begin{bmatrix} x \\ y \\ 1 \end{bmatrix}$$

## 4 - Example

### 4.1 - One point

• Scale Matrix Definition: To scale the point by two in the vertical direction, the corresponding matrix will be in two dimensions:

$$\begin{bmatrix} 1 & 0 \\ 0 & 2 \end{bmatrix}$$

$$\begin{bmatrix}x' \\ y'\end{bmatrix} = \begin{bmatrix}1x \\ 2y\end{bmatrix} = \begin{bmatrix} 1 & 0 \\ 0 & 2 \end{bmatrix} \begin{bmatrix}x \\ y\end{bmatrix}$$

### 4.2 - Many points

To apply such a transformation to many points at the same time, the matrix-vector definition of matrix-matrix multiplication is used. The points are putted together to form a position matrix that is left-multiplied by the matrix representing the transformation: $$\begin{bmatrix} 1 & 0 \\ 0 & 2 \end{bmatrix} \begin{bmatrix} \begin{array}{r|r|r} x_1 & x_2 & x_3 \\ y_1 & y_2 & y_3 \end{array} \end{bmatrix} \begin{bmatrix} \begin{array}{r|r|r} 1x_1 & 1x_2 & 1x_3 \\ 2y_1 & 2y_2 & 2y_3 \end{array} \end{bmatrix}$$