Geometry - Scaling

> Geometry (Spatial, Linear Algebra)

1 - About

Advertising

3 - 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>

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:

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

<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>

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: <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>