Functions from vectors to vectors — scaling, reflection, rotation, shear, projection, composition, and the matrix representation of geometric change
This chapter introduces one of the most important ideas in all of mathematics: a linear transformation. You have spent several chapters learning what vectors are, how systems of equations describe linear conditions, how matrices encode data and operations, and how inverses and determinants reveal structural information about matrices. Now it is time to bring those ideas together into a unified concept.
A linear transformation is a function. It takes a vector as input and produces a vector as output. But it is not just any function — it is a function that respects the structure of vectors. It preserves the operations of vector addition and scalar multiplication. This preservation is what makes linear transformations so powerful, so analyzable, and so widely useful across mathematics, science, engineering, computing, and data science.
This chapter is also one of the most visual chapters in this book. Almost every linear transformation has a geometric meaning: it stretches, shrinks, rotates, reflects, shears, or projects space. Learning to see transformations geometrically will help you understand not just the algebra, but the shape and behavior of mathematical change.
Suppose you are working with a computer graphics program. You have a triangle defined by three corner points in the coordinate plane. You want to rotate the entire triangle by 45° around the origin, then reflect it across the x-axis, then scale it to be twice as large. Each operation is described by a matrix. How can three separate operations collapse into one single matrix multiplication? And what happens when you try to reverse all three operations at once? Chapter 7 answers these questions.
In Algebra II and Precalculus, you worked with functions from real numbers to real numbers: f(x) = 2x + 3, g(x) = x². These functions accept a single number and return a single number. Linear transformations are functions from vectors to vectors — they accept an input vector describing a point or direction and return an output vector describing where that point or direction moves. This generalization is fundamental to multivariable mathematics.
When you reach Calculus, the Jacobian matrix — central to multivariable calculus — is essentially a linear transformation describing how a function behaves near a point. Beyond calculus, linear transformations appear in computer graphics (rotation, scaling, projection), robotics (joint kinematics), physics (coordinate frame changes), data science (dimensionality reduction, PCA), signal processing, and economics.
A linear transformation is a function that takes vectors as inputs and produces vectors as outputs, while preserving the two most fundamental operations of vector algebra: addition and scalar multiplication.
Before the formal definition, consider the function T(x, y) = (2x, 2y), which doubles every vector. If you add two vectors and then double, you get the same answer as doubling each vector first and then adding. If you scale a vector by 5 and then double, you get the same as doubling first and then scaling. These two observations are not accidents — they are the defining properties of a linear transformation.
Let T : ℝⁿ → ℝᵐ be a function from ℝⁿ to ℝᵐ. We say T is a linear transformation if it satisfies both of the following properties for all vectors u, v ∈ ℝⁿ and all scalars c ∈ ℝ:
Property 1 — Additivity: T(u + v) = T(u) + T(v)
Property 2 — Homogeneity: T(cu) = c T(u)
Together, these may be written: T(cu + dv) = c T(u) + d T(v) for all vectors u, v and all scalars c, d.
Linearity means the transformation respects vector structure. Geometrically, a linear transformation must map the zero vector to the zero vector (it cannot shift the origin), must map lines through the origin to lines through the origin, must map equally spaced points on a line to equally spaced points on the image line, and must preserve parallel structure. This last point is key to why linear transformations are so useful in graphics: they move shapes in structured ways that maintain relationships between points.
A function that shifts the origin — like T(x, y) = (x + 3, y − 1) — is not a linear transformation, because T(0) = (3, −1) ≠ 0. A function with a nonlinear rule — like T(x, y) = (x², y) — is not linear either. These are useful functions, but they are not linear transformations in the strict sense.
To understand linear transformations clearly, it helps to be explicit about what kind of function they are. The domain of T is ℝⁿ: all input vectors. The codomain of T is ℝᵐ: all possible output vectors. The domain and codomain do not need to have the same dimension. A linear transformation can take a 3-dimensional vector and return a 2-dimensional vector, or vice versa. The notation T : ℝⁿ → ℝᵐ is read as "T is a function from ℝⁿ to ℝᵐ."
| Notation | Domain | Codomain | Example Rule |
|---|---|---|---|
| T : ℝ² → ℝ² | ℝ² | ℝ² | T(x, y) = (3x − y, 2x + 4y) |
| T : ℝ³ → ℝ² | ℝ³ | ℝ² | T(x, y, z) = (x + 2y, 3z − y) |
| T : ℝ² → ℝ³ | ℝ² | ℝ³ | T(x, y) = (x, y, x + y) |
We write T(x) for the output of T applied to input vector x. Some textbooks write Tx without parentheses when the context is clear. Both are standard.
To verify that a transformation is linear, you must check both properties for arbitrary vectors and scalars — not just for specific numerical examples. A single numerical check can show that a property holds for that case, but cannot prove it holds in general. A single counterexample, however, is sufficient to prove that a function is not linear.
T(u + v) = T(u₁+v₁, u₂+v₂)
= (3(u₁+v₁)−(u₂+v₂), 2(u₁+v₁)+4(u₂+v₂))
= (3u₁−u₂+3v₁−v₂, 2u₁+4u₂+2v₁+4v₂)
T(u) + T(v) = (3u₁−u₂, 2u₁+4u₂) + (3v₁−v₂, 2v₁+4v₂)
= (3u₁−u₂+3v₁−v₂, 2u₁+4u₂+2v₁+4v₂) ✓
T(cu) = T(cu₁, cu₂)
= (3cu₁−cu₂, 2cu₁+4cu₂)
= c(3u₁−u₂, 2u₁+4u₂)
= c T(u) ✓
T(0, 0) = (0+1, 0) = (1, 0) ≠ (0, 0)Every linear transformation satisfies T(0) = 0. If T(0) ≠ 0, the function is immediately not linear — no further checking is needed. If T(0) = 0, you must still verify both defining properties fully to confirm linearity.
Every linear transformation from ℝⁿ to ℝᵐ can be represented as multiplication by a matrix. This is one of the central theorems of linear algebra: linear transformations and matrices are two descriptions of the same mathematical object.
If T : ℝⁿ → ℝᵐ is a linear transformation, then there exists a unique m × n matrix A such that T(x) = Ax for all x ∈ ℝⁿ. Conversely, for any m × n matrix A, the function T(x) = Ax is a linear transformation from ℝⁿ to ℝᵐ.
For any matrix A and vectors u, v, and scalar c:
A(u + v) = Au + Av (distributivity of matrix multiplication — Chapter 4)
A(cu) = c(Au) (scalar multiplication rule — Chapter 4)
Linearity of T(x) = Ax follows directly from properties of matrix multiplication.
If A is m × n, then the input x must be in ℝⁿ (n components, matching A's columns) and the output Ax lands in ℝᵐ (m components, matching A's rows). A 2 × 3 matrix transforms ℝ³ into ℝ². A 3 × 2 matrix transforms ℝ² into ℝ³.
T([4, 1]) = [2 −1] [4] = [2(4)+(−1)(1)] = [7]
[0 3] [1] [0(4)+ 3(1)] [3]
Given a linear transformation T described geometrically or verbally, how do we find its matrix? The answer lies in what happens to the standard basis vectors. Because every vector in ℝⁿ is a linear combination of the standard basis vectors, and because T is linear, T is completely determined by where it sends each basis vector.
In ℝ²: e₁ = (1, 0) and e₂ = (0, 1). In ℝ³: e₁ = (1, 0, 0), e₂ = (0, 1, 0), e₃ = (0, 0, 1).
The standard matrix A of T : ℝⁿ → ℝᵐ is the m × n matrix whose columns are the images of the standard basis vectors:
A = [ T(e₁) T(e₂) ··· T(eₙ) ]
The first column of A is T(e₁), the second is T(e₂), and so on. Columns of A tell you where the coordinate directions go under T.
A = [T(e₁) T(e₂)] = [2 0] = 2I
[0 2]T(e₁) = T(1, 0) = (1−0, 2·1, 3·0) = (1, 2, 0)
T(e₂) = T(0, 1) = (0−1, 2·0, 3·1) = (−1, 0, 3)
[ 1 −1]
A = [ 2 0]
[ 0 3]
A scaling transformation multiplies every vector by a fixed factor. It stretches or compresses every direction. Uniform scaling by factor k has standard matrix kI. Non-uniform scaling stretches different axes by different factors.
| Type | Standard Matrix | Geometric Effect | det(A) |
|---|---|---|---|
| Uniform scale by k | kI = [[k,0],[0,k]] | All distances multiplied by k | k² |
| Scale x by k₁, y by k₂ | [[k₁,0],[0,k₂]] | Different stretches per axis | k₁k₂ |
Diagram description: Imagine the unit square with corners at (0,0), (1,0), (1,1), (0,1). Under non-uniform scaling with k₁ = 3 and k₂ = 2, the corners become (0,0), (3,0), (3,2), (0,2). The shape remains a rectangle but is now 3 units wide and 2 units tall. The area scales by k₁ · k₂ = 6, matching the determinant.
T([2, 4]) = [3 0 ] [2] = [3·2 + 0·4 ] = [6]
[0 1/2] [4] [0·2 + (1/2)·4] [2]A reflection flips every vector across a line in ℝ². The line acts like a mirror. Points on the mirror line do not move. Points on either side swap positions.
| Reflection Across | Standard Matrix | Effect |
|---|---|---|
| x-axis | [[1, 0], [0, −1]] | Negates y; keeps x |
| y-axis | [[−1, 0], [0, 1]] | Negates x; keeps y |
| Line y = x | [[0, 1], [1, 0]] | Swaps x and y |
| Line y = −x | [[0, −1], [−1, 0]] | Swaps and negates both |
Every reflection has det(A) = −1. The negative determinant encodes orientation reversal — a right-handed figure becomes left-handed.
Every reflection is its own inverse: A² = I, so A⁻¹ = A. Reflecting twice returns to the original.
Diagram description: The point (2, 3) reflected across the x-axis becomes (2, −3). Reflected across the y-axis it becomes (−2, 3). Reflected across y = x it becomes (3, 2). In each case, the point's distance from the mirror line is preserved; only its position relative to the line changes.
A = [−1 0]
[ 0 1]T(1,2) = (−1, 2)
T(3,2) = (−3, 2)
T(2,5) = (−2, 5)
A rotation turns every vector in the plane through a fixed angle θ around the origin. The derivation uses the standard basis vectors: under a counterclockwise rotation by θ, the unit vector e₁ = (1, 0) moves to the point at angle θ from the positive x-axis, which is (cos θ, sin θ). The unit vector e₂ = (0, 1) starts at angle 90° and rotates to angle 90° + θ, giving (cos(90° + θ), sin(90° + θ)) = (−sin θ, cos θ).
R_θ = [[cos θ, −sin θ], [sin θ, cos θ]]
The columns are where e₁ and e₂ go under the rotation.
Key properties: det(R_θ) = cos²θ + sin²θ = 1. Rotations preserve area and orientation. R_θ · R_φ = R_{θ+φ}. Rotating by θ then by φ equals rotating by θ + φ. R_θ⁻¹ = R_{−θ} = R_θᵀ. Rotation matrices are orthogonal.
Diagram description: The unit circle gives a visual anchor. A point (1, 0) on the positive x-axis, after a counterclockwise rotation by 45°, lands at (√2/2, √2/2) — exactly halfway between the x-axis and y-axis directions. After 90°, it lands at (0, 1) on the y-axis. After 180°, at (−1, 0). The rotation keeps the point on the unit circle because rotation preserves length.
R₉₀° [3] = [0·3 + (−1)·1] = [−1]
[1] [1·3 + 0·1] [ 3]R₄₅° [2] = [(√2/2)(2) + (−√2/2)(0)] = [√2]
[0] [(√2/2)(2) + (√2/2)(0)] [√2]
A shear displaces points in one direction proportionally to their coordinate in a perpendicular direction. Points with y = 0 do not move horizontally; points with y = 1 shift by k; points with y = 2 shift by 2k. The transformation slides layers of the plane past each other, like a deck of cards being pushed from the side.
| Type | Standard Matrix | Effect on Unit Square | det(A) |
|---|---|---|---|
| Horizontal shear by k | [[1, k], [0, 1]] | Top edge slides k units right; bottom stays | 1 |
| Vertical shear by k | [[1, 0], [k, 1]] | Right edge slides k units up; left stays | 1 |
Diagram description: The unit square under a horizontal shear with k = 2. Corners (0,0) and (1,0) stay fixed (y = 0). Corner (0,1) moves to (2,1) and corner (1,1) moves to (3,1). The square becomes a parallelogram leaning to the right. Its area is still 1 square unit, consistent with det = 1.
T(0,0) = (0,0) T(1,0) = (1,0)
T(1,1) = (3,1) T(0,1) = (2,1)
A projection maps every vector onto a lower-dimensional subspace — typically a line — by dropping its component perpendicular to that subspace. Every point in the plane is "shadowed" down onto the line, losing any information about how far it was from the line. Projections are used in data analysis, physics, and approximation.
| Projection Onto | Standard Matrix | Effect |
|---|---|---|
| x-axis | [[1, 0], [0, 0]] | Drops y; keeps x |
| y-axis | [[0, 0], [0, 1]] | Drops x; keeps y |
| Line y = x | [[1/2, 1/2], [1/2, 1/2]] | Projects onto 45° diagonal |
Idempotent: Applying the projection twice gives the same result as applying it once: A² = A. If a point is already on the x-axis, projecting again does not move it.
Not invertible: det(A) = 0. Many different points map to the same projected point (all points on a vertical line have the same shadow on the x-axis). The original cannot be recovered from its shadow alone.
A² = [1 0][1 0] = [1·1+0·0 1·0+0·0] = [1 0] = A ✓
[0 0][0 0] [0·1+0·0 0·0+0·0] [0 0]
When two linear transformations are applied one after another, the combined effect is also a linear transformation. This is the composition of the two transformations. If T₁ : ℝⁿ → ℝᵐ and T₂ : ℝᵐ → ℝᵖ, then the composition T₂ ∘ T₁ is defined by (T₂ ∘ T₁)(x) = T₂(T₁(x)): apply T₁ first, then apply T₂.
If T₁(x) = A₁x and T₂(x) = A₂x, then:
(T₂ ∘ T₁)(x) = A₂(A₁x) = (A₂A₁)x
The standard matrix of the composition is A₂A₁ — with A₁ on the right (applied first) and A₂ on the left (applied second). This is precisely why matrix multiplication is defined as it is: it encodes composition of linear transformations.
Because matrix multiplication is not commutative in general, the order of composition matters. "Rotate first, then reflect" gives A_reflect · A_rotate. "Reflect first, then rotate" gives A_rotate · A_reflect. These are different matrices that produce different results. Always place the first-applied transformation's matrix on the right.
A₁ (reflect, x-axis) = [ 1 0]
[ 0 −1]
A₂ (rotate 90° CCW) = [ 0 −1]
[ 1 0]
A₂A₁ = [ 0 −1][ 1 0] = [0·1+(−1)·0 0·0+(−1)·(−1)] = [0 1]
[ 1 0][ 0 −1] [1·1+ 0·0 1·0+ 0·(−1)] [1 0]
A₁A₂ = [ 1 0][ 0 −1] = [0 −1]
[ 0 −1][ 1 0] [−1 0]
A₁ (scale 2) = [2 0]
[0 2]
A₂ (rotate 90°) = [0 −1]
[1 0]
A₃ (reflect x) = [1 0]
[0 −1]
A₃A₂ = [1 0][0 −1] = [0 −1]
[0 −1][1 0] [−1 0]
A₃A₂A₁ = [0 −1][2 0] = [0 −2]
[−1 0][0 2] [−2 0]
If a linear transformation T : ℝⁿ → ℝⁿ is invertible, there exists a linear transformation T⁻¹ : ℝⁿ → ℝⁿ such that T⁻¹(T(x)) = x for all x. The inverse transformation "undoes" what T does. If T(x) = Ax, then T is invertible if and only if A is invertible (det(A) ≠ 0), and T⁻¹(x) = A⁻¹x.
| Transformation | Inverse | Reason |
|---|---|---|
| Rotation by θ | Rotation by −θ | Rotating back undoes the rotation |
| Reflection across a line | Same reflection | Reflecting twice returns to original: A² = I |
| Scaling by k ≠ 0 | Scaling by 1/k | Undoing the stretch |
| Horizontal shear by k | Horizontal shear by −k | Shearing back by same amount |
| Projection | No inverse exists | det = 0; information about perpendicular direction is lost |
det(A) = 2·1 − 1·1 = 1 ≠ 0
A⁻¹ = (1/1)[ 1 −1] = [ 1 −1]
[−1 2] [−1 2]
So T⁻¹(x, y) = (x − y, −x + 2y)
Linear transformations are not abstract mathematical curiosities — they are the computational machinery behind some of the most important technologies in use today.
Every time a 3D scene is rendered on a 2D screen, linear transformations are doing the work. Rotation matrices orient objects in three-dimensional space. Scaling matrices resize objects. Projection matrices map three-dimensional scenes onto two-dimensional screens. A graphics pipeline might apply dozens of transformations in sequence — but because all are matrix multiplications, the entire sequence collapses into a single matrix product. This is why modern graphics processors (GPUs) are optimized for fast matrix multiplication.
Pure translations are not linear transformations (they shift the origin). In graphics this is handled using homogeneous coordinates: 2D points (x, y) are represented as 3D vectors (x, y, 1), and translations become linear transformations in the higher-dimensional space. Students will study this in a graphics or advanced linear algebra course.
A robotic arm is a sequence of rigid bodies joined at pivots. The position and orientation of the arm's endpoint is computed by composing rotation and translation matrices — one for each joint. This is called forward kinematics. The same mathematics controls animation rigs in video games and films: a character's skeleton is driven by composing transformation matrices at each joint.
In physics, different observers may use different coordinate frames. A rotation matrix transforms measurements from one frame to another. These frame transformations appear in mechanics, electromagnetism, special relativity, and quantum mechanics. Understanding rotation matrices now prepares you for the tensor transformations of advanced physics.
A dataset of n observations with p features forms a matrix. A linear transformation can map this high-dimensional data into a lower-dimensional space while preserving as much structure as possible. This is the foundation of principal component analysis (PCA). PCA finds the most important directions using eigenvalues and eigenvectors (Chapter 12), but the core operation is a matrix multiplication — a linear map from high-dimensional feature space to a lower-dimensional representation.
| Transformation | Standard Matrix | det(A) |
|---|---|---|
| Identity | [[1,0],[0,1]] | 1 |
| Uniform scaling by k | [[k,0],[0,k]] | k² |
| Non-uniform scaling (k₁, k₂) | [[k₁,0],[0,k₂]] | k₁k₂ |
| Reflection, x-axis | [[1,0],[0,−1]] | −1 |
| Reflection, y-axis | [[−1,0],[0,1]] | −1 |
| Reflection, y = x | [[0,1],[1,0]] | −1 |
| Reflection, y = −x | [[0,−1],[−1,0]] | −1 |
| Rotation CCW by θ | [[cosθ, −sinθ],[sinθ, cosθ]] | 1 |
| Horizontal shear by k | [[1,k],[0,1]] | 1 |
| Vertical shear by k | [[1,0],[k,1]] | 1 |
| Projection, x-axis | [[1,0],[0,0]] | 0 |
| Projection, y-axis | [[0,0],[0,1]] | 0 |
Correct: The first transformation to be applied goes on the RIGHT. "Rotate then reflect" → A_reflect · A_rotate. The matrix on the left is applied last.
Correct: Matrix multiplication is generally not commutative. The order of composition matters. Always verify the intended order.
Correct: Projections are not invertible. det(A) = 0. Infinitely many input vectors (all points on any vertical line) map to the same output point on the x-axis. The lost perpendicular information cannot be recovered.
Correct: A matrix is a representation of a linear transformation in a particular coordinate system. The same transformation can be described by different matrices in different bases. The underlying transformation (the geometric action) does not change when the basis changes.
Correct: That is the KERNEL (null space), not the image. The KERNEL of T is {x : T(x) = 0} — vectors that get sent to zero. The IMAGE of T is the set of all output vectors T(x) — this equals the column space of the matrix.
Correct: T(x) = Ax + b (with b ≠ 0) is an AFFINE transformation, not a linear transformation. It does not map the zero vector to itself. The linear part is Ax; the translation by b makes it affine, not linear.
Correct: CCW rotation by θ is [[cosθ, −sinθ], [sinθ, cosθ]]. The −sinθ belongs in the top-right position (the first row, second column). Clockwise rotation by θ uses [[cosθ, sinθ], [−sinθ, cosθ]].
Correct: A transformation must be applied to every defining point of a geometric figure. Compute T for each vertex separately. This is not just repetitive work — different vertices may move in different directions under a non-uniform transformation.
For each matrix, identify the type of transformation (scaling, reflection, rotation, shear, projection, or other) and describe its geometric effect.
[[1,0],[0,1]][[−1,0],[0,−1]][[5,0],[0,5]][[1,3],[0,1]][[0,−1],[1,0]][[√3/2,−1/2],[1/2,√3/2]][[0,0],[0,1]][[0,1],[1,0]][[3,0],[0,−2]][[1,0],[−5,1]]Each problem below contains a mistake. Identify the error and explain the correct approach.
Identify the error. Write the correct matrix product and explain which transformation should be on the right.
What is wrong? Explain why projections cannot be inverted, using the concepts of det and information loss.
Why is a single numerical check insufficient? What must be done to properly verify linearity?
Explain why this is incorrect. Under what (very limited) circumstances would all vertices move identically?
Identify the error. Use the zero-vector test to show T is not linear, and explain what type of transformation it is.
Chapter 7 showed that linear transformations are functions that preserve the structure of vectors — and that every such function has a matrix representation. The next step is to study the spaces that these transformations act on.
Part III begins with Chapter 8: Vector Spaces and Subspaces. You will learn to recognize collections of objects — vectors in ℝⁿ, polynomials, matrices, sequences — that behave like vectors: they can be added and scaled according to consistent rules. The column space, null space, and row space of a matrix (studied in Chapters 8 and 10) are the natural subspaces that arise from the linear transformation T(x) = Ax. Everything you built in Chapters 1 through 7 — systems, row reduction, matrices, inverses, determinants, and transformations — will be unified in the language of vector spaces.
In Chapters 12 and 13 you will revisit linear transformations through eigenvalues and eigenvectors: the directions that a transformation leaves unchanged in orientation, only scaling them. These special directions are central to data science, physics, discrete dynamical systems, and the solution of differential equations. They are the deepest structural feature of a linear transformation.
In Multivariable Calculus, the Jacobian matrix of a vector-valued function at a point is precisely the matrix of the best linear approximation to that function near the point. Every concept from Chapter 7 — standard matrices, composition, invertibility, geometric behavior — reappears in the study of multivariable change. Linear transformations are the local language of nonlinear functions. Understanding them now will make the Jacobian feel natural when you encounter it.