A linear transformation (or linear map) is a function T from one vector space to another that respects the two vector-space operations: addition and scalar multiplication. Formally, T is linear when both of the following hold for all vectors u,v and every scalar c:
Together these say: “transform first, then add/scale” gives the same result as “add/scale first, then transform.” Equivalently, for any linear combination,
T(c1u+c2v)=c1T(u)+c2T(v).
Linear example: scaling. Define T:R2→R2 by T(x)=3x. Then
T(u+v)=3(u+v)=3u+3v=T(u)+T(v),
and T(cu)=3(cu)=c(3u)=cT(u). Scaling by a fixed factor is linear. Reflection through the origin (T(x)=−x), rotation about the origin, and projection onto a line through the origin are also linear — we will meet them as matrices below.
Non-linear counterexample: adding a constant. Define S(x)=x+b for a fixed nonzero shift b (translation). Then
S(u+v)=u+v+b,S(u)+S(v)=(u+b)+(v+b)=u+v+2b.
These agree only when b=0. Translation moves the origin; linear maps must send 0 to 0, because T(0)=T(0⋅u)=0⋅T(u)=0. Any map that moves the origin fails linearity.
Why this matters. Linearity is the contract that lets us represent a whole map by a finite table of numbers — a matrix — and compose maps by multiplying those tables. Everything from solving Ax=b to changing bases and projecting data assumes this structure.
An m×nmatrixA is a rectangular array of real numbers with m rows and n columns. Write its columns as vectors a1,a2,…,an∈Rm. For a vector x=x1⋮xn∈Rn, the matrix–vector product is the linear combination of those columns weighted by the entries of x:
Ax=x1a1+x2a2+⋯+xnan.
The result lives in Rm. In components, the i-th entry of Ax is the dot product of the i-th row of A with x.
Worked example. Let
A=(1324),x=(5−1).
The columns are a1=(13) and a2=(24), so
Ax=5(13)+(−1)(24)=(515)+(−2−4)=(311).
Linearity of x↦Ax. By the column definition,
A(u+v)=(u1+v1)a1+⋯=Au+Av,A(cu)=c(Au).
So every matrix defines a linear transformation TA(x)=Ax from Rn to Rm.
Every linear map has a matrix. Conversely, if T:Rn→Rm is linear, let e1,…,en be the standard basis of Rn and form the matrix A whose j-th column is T(ej). Then for any x=x1e1+⋯+xnen,
T(x)=x1T(e1)+⋯+xnT(en)=Ax.
So linear transformations Rn→Rm and m×n matrices are two views of the same object: the map, and the table that stores where the basis goes.
If B is n×p and A is m×n, the product AB is the m×p matrix defined so that
(AB)x=A(Bx)
for every x∈Rp. In words: applying AB means apply B first, then apply A. Equivalently, AB is the matrix of the composition A∘B: the right-hand factor acts first, then the left-hand factor.
How to compute AB. The j-th column of AB is A times the j-th column of B. Equivalently, entry (i,j) of AB is the dot product of row i of A with column j of B. The product is defined only when the inner dimensions match (n above).
Three families of 2×2 matrices appear constantly in geometry, graphics, and robotics. Each is linear, so each is completely determined by where it sends the standard basis vectors e1=(10) and e2=(01).
Rotation by angle θ (counterclockwise about the origin).
Rθ=(cosθsinθ−sinθcosθ).
The first column is where e1 goes: (cosθ,sinθ). The second is where e2 goes: (−sinθ,cosθ). For θ=90∘=π/2, cos90∘=0 and sin90∘=1, so
R90∘=(01−10).
This sends (x,y) to (−y,x): the unit square’s corner (1,0) maps to (0,1), and (0,1) maps to (−1,0). Lengths and angles are preserved; only orientation in the plane changes.
Scaling (stretch or shrink along the axes).
(a00b)
sends (x,y) to (ax,by). If a=b, the map is a uniform scale (similarity). If a=b, a circle becomes an ellipse elongated along the axis with larger absolute factor. For example, (2001) doubles horizontal distances and leaves vertical ones unchanged. Negative a or b also reflects through the corresponding axis.
Projection onto the x-axis.
(1000)
sends (x,y) to (x,0). Every point collapses vertically onto the horizontal axis. A unit square with vertices at (0,0), (1,0), (1,1), (0,1) becomes the segment from (0,0) to (1,0) (the top edge lands on the bottom). Projection is linear but not invertible: many inputs share the same output, and applying it twice is the same as applying it once (it is a projection operator: P2=P).
Acting on a simple shape. Take the unit square’s vertices as columns of a 2×4 matrix of points (or a closed path with five points including the return to the start). Multiplying on the left by Rθ, by a diagonal scale matrix, or by the x-axis projection transforms every vertex the same way. The browser lab below rotates a square by 90∘ and plots original versus image — the same recipe works for scaling and projection.
These geometric maps are the building blocks of Week 3’s elementary matrices (row operations as left-multiplication) and of the four-subspace picture in Week 6 (kernel and range of A).
Exercise · Multiple choice
Which 2×2 matrix rotates every vector in the plane by 90° counterclockwise?