Facebook Pixel
Mathos AI logo

Matrices as Transformations

Matrices as Transformations

In linear algebra, matrices are not just grids of numbers—they are actions. A 2×22 \times 2 matrix can represent a linear transformation of the 2D plane, mapping any point (x,y)(x, y) to a new point (x,y)(x', y').

How It Works

To apply a transformation, we multiply the transformation matrix by a column vector representing our point:

[xy]=[abcd][xy]=[ax+bycx+dy]\begin{bmatrix} x' \\ y' \end{bmatrix} = \begin{bmatrix} a & b \\ c & d \end{bmatrix} \begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} ax + by \\ cx + dy \end{bmatrix}

Common Transformations

Scaling

A scaling matrix stretches or compresses the plane along the x and y axes.

[kx00ky]\begin{bmatrix} k_x & 0 \\ 0 & k_y \end{bmatrix}

If kx=2k_x = 2, the x-coordinates are doubled. If ky=0.5k_y = 0.5, the y-coordinates are halved.

Reflections

Matrices can reflect points across specific lines.

  • Over the x-axis: [1001]\begin{bmatrix} 1 & 0 \\ 0 & -1 \end{bmatrix}
  • Over the y-axis: [1001]\begin{bmatrix} -1 & 0 \\ 0 & 1 \end{bmatrix}

Rotations

To rotate a point counterclockwise around the origin by an angle θ\theta, use the rotation matrix:

[cosθsinθsinθcosθ]\begin{bmatrix} \cos \theta & -\sin \theta \\ \sin \theta & \cos \theta \end{bmatrix}

Composing Transformations

If you want to apply transformation AA and then transformation BB, you can simply multiply their matrices. The combined transformation matrix is BABA. Note that matrix multiplication is not commutative, so the order matters: BABA means transformation AA happens first, followed by BB.

Example Problems

Example 1: Find the matrix that rotates the plane by 9090^\circ counterclockwise.

Using the rotation matrix formula with θ=90\theta = 90^\circ:

cos(90)=0,sin(90)=1\cos(90^\circ) = 0, \quad \sin(90^\circ) = 1

Substituting these into the rotation matrix gives:

[0110]\begin{bmatrix} 0 & -1 \\ 1 & 0 \end{bmatrix}

Example 2: Apply the matrix [2003]\begin{bmatrix} 2 & 0 \\ 0 & 3 \end{bmatrix} to the triangle with vertices (1,1)(1,1), (2,0)(2,0), (0,2)(0,2).

We multiply the matrix by each vertex (written as column vectors):

[2003][11]=[23]\begin{bmatrix} 2 & 0 \\ 0 & 3 \end{bmatrix} \begin{bmatrix} 1 \\ 1 \end{bmatrix} = \begin{bmatrix} 2 \\ 3 \end{bmatrix}

[2003][20]=[40]\begin{bmatrix} 2 & 0 \\ 0 & 3 \end{bmatrix} \begin{bmatrix} 2 \\ 0 \end{bmatrix} = \begin{bmatrix} 4 \\ 0 \end{bmatrix}

[2003][02]=[06]\begin{bmatrix} 2 & 0 \\ 0 & 3 \end{bmatrix} \begin{bmatrix} 0 \\ 2 \end{bmatrix} = \begin{bmatrix} 0 \\ 6 \end{bmatrix}

The new vertices of the transformed triangle are (2,3)(2,3), (4,0)(4,0), and (0,6)(0,6).