Matrices Are Functions
In the previous lessons, we learned how to organize data in matrices and perform operations like addition and multiplication. Now we make a conceptual leap: every matrix is a function. Specifically, it is a linear transformation — a function that maps vectors to vectors in a way that preserves the algebraic structure of the vector space.
When you multiply a matrix A by a vector x, you are not just doing arithmetic — you are applying a geometric transformation to the vector. The matrix A "moves" x to a new location in space: Ax is the image of x under the transformation.
Definition: What Makes a Transformation Linear?
A function T from ℝⁿ to ℝᵐ is called a linear transformation if it satisfies two properties for all vectors u, v ∈ ℝⁿ and all scalars c:
- Additivity: T(u + v) = T(u) + T(v)
- Homogeneity: T(cu) = c · T(u)
These two properties can be combined into a single statement: T(αu + βv) = αT(u) + βT(v) for all scalars α, β. This says that T commutes with linear combinations.
A linear transformation is one that maps lines to lines (or possibly collapses them to points), keeps the origin fixed, and preserves parallelism. Straight lines remain straight. Grid lines remain parallel and evenly spaced (though perhaps rotated or scaled). Non-linear deformations — like bending or twisting — are not allowed.
Every Matrix Is a Linear Transformation
The fundamental theorem connecting matrices and linear transformations:
Reading a Transformation from Its Matrix
Here is the key insight: the columns of A are the images of the standard basis vectors. In ℝ², the standard basis vectors are e₁ = [1, 0]ᵀ and e₂ = [0, 1]ᵀ. If A = [a₁ | a₂], then:
- A·e₁ = a₁ (the first column): e₁ maps to the first column of A.
- A·e₂ = a₂ (the second column): e₂ maps to the second column of A.
Once you know where the basis vectors go, you know where everything goes — because any vector is a linear combination of basis vectors, and T must preserve linear combinations.
Common 2D Transformations
The Rotation Matrix
The rotation matrix is among the most beautiful in linear algebra. To rotate e₁ = [1,0]ᵀ counterclockwise by θ, it lands at [cosθ, sinθ]ᵀ. To rotate e₂ = [0,1]ᵀ, it lands at [−sinθ, cosθ]ᵀ. Putting these as columns:
Composition: Matrix Multiplication is Function Composition
Suppose you want to apply transformation A first, then transformation B. In function notation, this is B(A(x)) = (B∘A)(x). In matrix notation, this is simply (BA)x. Matrix multiplication encodes the composition of transformations.
This gives geometric meaning to matrix multiplication. For example:
- Rotating by 90° then reflecting is a different transformation than reflecting then rotating by 90°.
- Scaling then rotating is different from rotating then scaling (if the scaling factors differ).
The rightmost matrix in a product is applied first. In BA, A is applied first, then B. This is why matrix multiplication is not commutative in general: AB ≠ BA because "do A then B" is generally different from "do B then A".
Invertible Transformations and the Determinant
A linear transformation T is invertible if there exists another transformation T⁻¹ such that T⁻¹(T(x)) = x for all x. Geometrically: T is invertible if and only if it doesn't "collapse" space — it maps distinct inputs to distinct outputs, with no information loss.
The algebraic criterion is the determinant:
Examples of determinants for our common transformations:
- Rotation: det = 1 (areas preserved, orientation preserved)
- Reflection: det = −1 (areas preserved, orientation reversed)
- Scaling by (a, d): det = ad (areas scaled by factor ad)
- Projection onto x-axis: det = 0 (all of ℝ² collapses onto a line — not invertible)
Applications of Linear Transformations
Linear transformations appear everywhere in applied mathematics:
- Computer graphics: 3D rotation, scaling, and projection matrices transform 3D objects onto 2D screens. Every frame rendered by a GPU involves millions of matrix-vector multiplications.
- Signal processing: The Discrete Fourier Transform (DFT) is a linear transformation from time-domain samples to frequency-domain coefficients. Filters are linear operators.
- Machine learning: Each layer of a neural network applies a linear transformation (the weight matrix) followed by a non-linear activation function.
- Robotics: Forward kinematics uses rotation and translation matrices to compute the position of a robot arm's end effector from joint angles.
- Quantum mechanics: Quantum states are vectors in Hilbert space, and quantum operators are linear transformations. Measurement is a projection.
Every matrix represents a linear transformation: a function on vectors that preserves addition and scalar multiplication. The columns of a matrix reveal where the standard basis vectors go under the transformation. Rotation, scaling, reflection, shear, and projection are all linear transformations with explicit matrix forms. Matrix multiplication is composition of transformations — the rightmost matrix acts first. The determinant measures how areas are scaled: det = 0 means the transformation collapses space (singular/not invertible), |det| = 1 means it preserves area.