## About

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

See also: Linear Algebra - Scalar (Multiplication|Product) - Scaling

## Articles Related

## Matrix multiplication

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

Using the standard transformation matrix notation, it would become: <MATH> \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} </MATH>

## Example

### One point

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

<MATH> \begin{bmatrix} 1 & 0 \\ 0 & 2 \end{bmatrix} </MATH>

- The scaling transformation of the point x,y applied with the matrix-vector multiplication would become:

<MATH> \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} </MATH>

### 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:
<MATH>
\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}
</MATH>