01 / 21

Linear Transformations
and Matrices

Discover how matrices encode geometric transformations like rotations, reflections, and scaling in the plane.

AP Precalculus

What Is a Linear Transformation?

A linear transformation is a function \( T: \mathbb{R}^n \to \mathbb{R}^m \) that satisfies two properties for all vectors \( \mathbf{u}, \mathbf{v} \) and scalar \( c \):

1
Additivity: \( T(\mathbf{u} + \mathbf{v}) = T(\mathbf{u}) + T(\mathbf{v}) \)
2
Homogeneity: \( T(c\mathbf{u}) = cT(\mathbf{u}) \)

Visualizing a Transformation

Original
\(\mathbf{e}_1\)
\(\mathbf{e}_2\)
T Transformed
\(T(\mathbf{e}_1)\)
\(T(\mathbf{e}_2)\)

Why Use Matrices?

Every linear transformation \( T: \mathbb{R}^2 \to \mathbb{R}^2 \) can be represented by a unique \( 2 \times 2 \) matrix. The columns of the matrix are simply where the basis vectors land:

Compact
One matrix encodes the entire transformation: no need to describe it geometrically.
Composable
Applying two transformations in sequence is just matrix multiplication: \( BA \).
Invertible
If \( \det(A) \neq 0 \), the transformation can be undone via \( A^{-1} \).

The Matrix-Transformation Theorem

This means: to find the matrix, just compute where each standard basis vector goes. No guessing, no formulas to memorize: track the basis vectors, and you have the matrix.

Gallery of Standard Matrices

Rotation \(90^\circ\)
\(\begin{bmatrix}0&-1\\1&0\end{bmatrix}\)
Reflect over \(x\)-axis
\(\begin{bmatrix}1&0\\0&-1\end{bmatrix}\)
Scale by 2
\(\begin{bmatrix}2&0\\0&2\end{bmatrix}\)
Horizontal Shear
\(\begin{bmatrix}1&1\\0&1\end{bmatrix}\)

Linear vs. Affine Transformations

Linear Affine
Formula \( T(\mathbf{x}) = A\mathbf{x} \) \( T(\mathbf{x}) = A\mathbf{x} + \mathbf{b} \)
Origin fixed? Yes, always Not necessarily
Lines stay straight? Yes Yes
Includes translations? No Yes
Example Rotation, scaling Rotation + shift

The Rotation Matrix

To rotate every point in the plane by angle \( \theta \) counterclockwise about the origin, use:

\(\mathbf{e}_1\)
\(R(\mathbf{e}_1)\)
\(\theta\)
Origin

How to Find the Standard Matrix

1
Identify the basis vectors. In \( \mathbb{R}^2 \), these are \( \mathbf{e}_1 = \begin{bmatrix}1\\0\end{bmatrix} \) and \( \mathbf{e}_2 = \begin{bmatrix}0\\1\end{bmatrix} \).
2
Apply the transformation to each. Compute \( T(\mathbf{e}_1) \) and \( T(\mathbf{e}_2) \) using the geometric description or formula.
3
Build the matrix. The results become the columns: \( A = \begin{bmatrix} T(\mathbf{e}_1) & T(\mathbf{e}_2) \end{bmatrix} \).
4
Verify. Pick a test vector \( \mathbf{v} \), compute \( A\mathbf{v} \), and confirm it matches the expected geometric result.

Example 1: Reflection over \( y = x \)

Problem: Find the standard matrix for the transformation that reflects every point across the line \( y = x \).

\(y=x\)
\(\mathbf{e}_1\)
\(T(\mathbf{e}_1)\)
\(T(\mathbf{e}_2)\)

Example 2: Rotation by \( 90^\circ \)

Problem: Write the matrix for a \( 90^\circ \) counterclockwise rotation about the origin.

Example 3: Composing Transformations

Problem: First scale by 2, then rotate \( 90^\circ \) CCW. Find the single matrix that does both.

Determinant as Area Scale Factor

The determinant of the transformation matrix tells you how areas change:

Area = 1 1 A Area = |det A| |det A|
\(\det\begin{bmatrix}a&b\\c&d\end{bmatrix}=ad-bc\)
\( |\det A| > 1 \)
Areas expand
\( |\det A| = 1 \)
Areas preserved (e.g., rotations)
\( \det A < 0 \)
Orientation flips

Inverse Transformations

If \( \det(A) \neq 0 \), the transformation is invertible: there exists \( A^{-1} \) that undoes it. For a \( 2 \times 2 \) matrix:

\(\det A \neq 0\)
Invertible: \( A^{-1} \) exists, no information is lost.
\(\det A = 0\)
Singular: the transformation collapses a dimension (not invertible).

Common Mistakes

✕ Wrong column order
Putting \( T(\mathbf{e}_2) \) in column 1 instead of column 2. The columns must match the basis vector order.
✕ Composition order
Writing \( S \cdot R \) when you mean "rotate first, then scale." The rightmost matrix acts first.
✕ Forgetting the sign in rotation
The \( -\sin\theta \) in the top-right is often dropped. Double-check: \( R_\theta = \begin{bmatrix}\cos\theta & -\sin\theta\\\sin\theta & \cos\theta\end{bmatrix} \).

Summary of Key Matrices

Transformation Matrix Determinant
Rotation by \(\theta\) \(\begin{bmatrix}\cos\theta&-\sin\theta\\\sin\theta&\cos\theta\end{bmatrix}\) 1
Reflect over the \(x\)-axis \(\begin{bmatrix}1&0\\0&-1\end{bmatrix}\) −1
Reflect over \(y=x\) \(\begin{bmatrix}0&1\\1&0\end{bmatrix}\) −1
Scale by \(k\) \(\begin{bmatrix}k&0\\0&k\end{bmatrix}\) \(k^2\)
Horizontal shear by \(k\) \(\begin{bmatrix}1&k\\0&1\end{bmatrix}\) 1

Worked practice: Practice Problems — computer graphics shear and reflection

Work through this original lesson problem, then reveal the solution and illustrations.

A computer graphics program applies two transformations in sequence to every vertex of a polygon: first a horizontal shear with matrix S = [ 1 2 ; 0 1 ], then a reflection over the x-axis with matrix R = [ 1 0 ; 0 −1 ]. (a) Find the single composite matrix M = RS that accomplishes both operations. (b) Apply M to the vertex P = (1, 3) and state the final coordinates. (c) Compute det(M) and interpret its geometric meaning.

Show answer and explanation

Rubric (5 points): [1 point] (a) Setting up the product: M = RS = [ 1 0 ; 0 −1 ] × [ 1 2 ; 0 1 ]. [1 point] (a) Correctly computing M = [ 1×1+0×0 1×2+0×1 ; 0×1+(−1)×0 0×2+(−1)×1 ] = [ 1 2 ; 0 −1 ]. [1 point] (b) Computing M × (1, 3): first component = 1×1 + 2×3 = 7, second component = 0×1 + (−1)×3 = −3. Final coordinates: (7, −3). [1 point] (c) det(M) = (1)(−1) − (2)(0) = −1. [1 point] (c) Interpretation: |det(M)| = 1 means area is preserved. The negative sign indicates the transformation reverses orientation (consistent with the presence of a reflection).

Two orders of polygon transformations at the same scale. The point (1,3) ends at (7,−3) in one order and (−5,−3) in the other.
Shearing then reflecting the sprite gives different vertices from reflecting then shearing, although both compositions preserve area magnitude.

Question 1 of 5

What is the standard matrix for a reflection over the y-axis?

Question 2 of 5

If \( A = \begin{bmatrix}2&1\\0&3\end{bmatrix} \), what is \(\det(A)\)?

Question 3 of 5

You want to first rotate \(90^\circ\) CCW, then scale by 3. Which product gives the correct combined matrix?

Question 4 of 5

A transformation has the matrix \(\begin{bmatrix}3&0\\0&0\end{bmatrix}\). Which statement is true?

Question 5 of 5

What is the standard matrix for the transformation that projects every point onto the x-axis?