A linear map multiplies the area of every shape by one fixed number. See why the number is the same for every shape, derive the formula ad - bc for a 2 by 2 matrix by cutting up a parallelogram, and check it by counting squares in code.
Explain why a linear map multiplies the area of every shape by the same factor.
Derive the area of the parallelogram spanned by two vectors, by cutting it out of a box and by base times height.
Compute the determinant ad - bc of a 2 by 2 matrix and use it to find the area of an image.
State how the determinant changes when every entry of a 2 by 2 matrix is multiplied by the same number.
In review. The maths and code on this page are checked by automated tests on every change, but an independent reader has not signed it off yet. Spot a mistake or a confusing step? Tell us.
The question
Stretch a photo to twice its width and it covers twice as much of the screen. Slant it or turn it and the answer is less obvious. A matrix moves every point of the plane at once, so it resizes every shape drawn on the plane. By how much? And how can one number, worked out from the four entries of the matrix, answer that for every shape at once?
Intuition
Take the running map of this course, \({T(x, y)} = {(x + y,\; -x + 2y)}\). Its matrix has the columns \({(1, -1)}\) and \({(1, 2)}\), the places where \(\ihat\) and \(\jhat\) land. Draw two shapes on the plane, a square and a disc, and watch what the map does to them.
M02.8.1-F1
The map \(T\) turns the unit square (area 1) into a parallelogram of area 3, and a disc of area 2 into an ellipse of area 6. Both areas have been multiplied by 3.
The square and the disc are different shapes in different places, and both grew by the same factor. That is the whole idea of this lesson:
A linear map multiplies the area of every shape by the same number.
We call that number the area factor of the map. It is 3 for \(T\). If you know what the map does to the one unit square, you know what it does to every area on the plane.
Machine learning leans on this number in two places. A model that reshapes data spreads it over more or less space, and the area factor says how much thinner or thicker the data now lies, which is exactly what is needed to keep probabilities adding up to 1. And when the factor is zero the map has flattened the plane, so it cannot be undone. The last two lessons of this module take up both.
Build it up
Why should a square and a disc be treated alike? The reason is the grid picture of a linear map from lesson M02.4.1: every grid cell becomes the same parallelogram.
Step 1. The unit square lands on the parallelogram of the columns. A point of the unit square is \({x\,\ihat + y\,\jhat}\) with \(x\) and \(y\) between 0 and 1. A linear map sends it to \({x\,T(\ihat) + y\,T(\jhat)}\): start at the origin, go a fraction \(x\) of the way along the first column and a fraction \(y\) of the way along the second. Those points fill the parallelogram that has the two columns as sides. Call its area \(k\).
Step 2. Every grid cell gets the same treatment. The cell whose corner is at \({(m, n)}\) holds the points \({(m + x,\; n + y)}\). Their images are \({T(m, n)} + {x\,T(\ihat)} + {y\,T(\jhat)}\), which is the same parallelogram moved so that it starts at \({T(m, n)}\). Moving a shape does not change its area, so every cell goes from area 1 to area \(k\).
Step 3. Small squares too. A square of side \(s\) with its corner at \(\vect{p}\) holds the points \({\vect{p} + sx\,\ihat + sy\,\jhat}\). Their images are \({T(\vect{p})} + {x\,(s\,T(\ihat))} + {y\,(s\,T(\jhat))}\): a parallelogram whose sides are \(s\) times the two columns. Its base and its height are both \(s\) times those of the big parallelogram, so its area is \(s^2 k\). The square had area \(s^2\). The ratio is \(k\) again.
Step 4. Any shape is made of small squares. Cover a shape with small squares. Each one grows by the factor \(k\), so the total grows by the factor \(k\).
M02.8.1-F2
The disc of area 2 holds 24 squares of side \(\tfrac14\), with total area \(1.5\). Their images are 24 small parallelograms with total area \(4.5\). Finer squares fill the disc better, so the two totals close in on 2 and 6, and at every stage the second total is 3 times the first.
So the area of the image is \(k\) times the area of the shape, where \(k\) is the area of one parallelogram: the image of the unit square. All that is left is to find a formula for \(k\).
Go deeper: what the phrase 'close in on' is hiding
The squares in the figure do not fill the disc: slivers are left along the edge. For any shape with a reasonable boundary, the total area of the squares that straddle the edge shrinks to zero as the squares shrink, so the count from inside and the count that includes the straddling squares squeeze the true area between them. Making “shrinks to zero” precise needs the idea of a limit, which belongs to calculus (course M04). In fact this squeezing is how the area of a curved shape is defined. The argument above is exact for every shape built from squares, and passes to curved shapes through that limit.
The formal statement
NoteDefinition and result: the determinant of a 2 by 2 matrix
The determinant of the matrix \({\mat{A} = \begin{bmatrix} a & b \\ c & d \end{bmatrix}}\) is the number
\[
\det \mat{A} \;=\; ad - bc .
\]
The linear map with matrix \(\mat{A}\) multiplies the area of every shape by \(\abs{\det \mat{A}}\).
By the four steps above, we only have to show that the parallelogram spanned by the columns \({(a, c)}\) and \({(b, d)}\) has area \({\abs{ad - bc}}\). We do it twice: once by cutting, where the picture does the work, and once by a method that covers every case.
Derivation 1: cut the parallelogram out of a box. Suppose for now that the four entries are positive and that the first column lies below the second, as drawn.
M02.8.1-F3
The parallelogram sits in a box of width \({a + b}\) and height \({c + d}\). Remove six pieces from the box, two of each kind, and the parallelogram is what remains.
The box has area
\[
(a + b)(c + d) \;=\; ac + ad + bc + bd .
\]
The pieces to remove are two triangles with legs \(a\) and \(c\), two triangles with legs \(b\) and \(d\), and two rectangles \(b\) wide and \(c\) tall:
\[
\begin{aligned}
& 2 \cdot \tfrac12 ac \;+\; 2 \cdot \tfrac12 bd \;+\; 2 \cdot bc \\
&\quad = ac + bd + 2bc .
\end{aligned}
\]
Subtract:
\[
\begin{aligned}
\text{area} &= (ac + ad + bc + bd) \\
&\quad {} - (ac + bd + 2bc) \\
&= ad + bc - 2bc \\
&= ad - bc .
\end{aligned}
\]
Derivation 2: base times height, for every case. Entries can be negative (our map \(T\) has \({c = -1}\)), and then the box picture changes. This argument does not care about signs. Write \({\vect{u} = (a, c)}\) and \({\vect{v} = (b, d)}\) for the columns, and take \(\vect{u}\) as the base, of length \({\norm{\vect{u}} = \sqrt{a^2 + c^2}}\).
Turn \(\vect{u}\) a quarter-turn anticlockwise to get \({\vect{n} = (-c, a)}\). It is perpendicular to \(\vect{u}\), because \({\vect{u} \cdot \vect{n}} = {a(-c) + c\,a} = 0\), and it has the same length, \({\norm{\vect{n}} = \sqrt{c^2 + a^2}}\). The height of the parallelogram is how far \(\vect{v}\) reaches in the direction of \(\vect{n}\). By the projection formula of lesson M02.3.4 that is \({\abs{\vect{v} \cdot \vect{n}} / \norm{\vect{n}}}\), and
\[
\vect{v} \cdot \vect{n} \;=\; b(-c) + d\,a \;=\; ad - bc .
\]
because \({\norm{\vect{u}} = \norm{\vect{n}}}\). (If \({\vect{u} = \vect{0}}\) there is no parallelogram, the area is 0, and \({ad - bc = 0}\) as well.) The two derivations agree, and the second explains the absolute value: \({ad - bc}\) can be negative, and an area cannot. The sign is not waste. It is the subject of the next lesson.
Three checks against maps you know. Lesson M02.4.3 listed area factors found by eye. The formula gives them back.
A stretch \(\begin{bmatrix} p & 0 \\ 0 & q \end{bmatrix}\) has determinant \({pq - 0 = pq}\): the unit square becomes a \(p\) by \(q\) rectangle.
A rotation \({\begin{bmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{bmatrix}}\) has determinant \({\cos^2\theta + \sin^2\theta = 1}\): turning changes no area.
A shear \(\begin{bmatrix} 1 & k \\ 0 & 1 \end{bmatrix}\) has determinant \({1 \cdot 1 - k \cdot 0 = 1}\): slanting changes no area either.
Scaling the whole matrix. Multiply every entry by \(s\):
Doubling a matrix doubles every length, so it multiplies every area by 4, not by 2.
Worked example
Find the area factor of \(T\), whose matrix is \({\begin{bmatrix} 1 & 1 \\ -1 & 2 \end{bmatrix}}\), by hand and by the formula.
The unit square lands on the parallelogram with corners \({(0, 0)}\), \({T(\ihat) = (1, -1)}\), \({T(\ihat) + T(\jhat) = (2, 1)}\) and \({T(\jhat) = (1, 2)}\).
M02.8.1-F4
The parallelogram of \(T\) inside a 2 by 3 box. Each corner of the box is a right-angled triangle whose legs can be read off the grid.
By hand. The parallelogram fits in the box from \({x = 0}\) to \(2\) and from \({y = -1}\) to \(2\), of area \({2 \times 3 = 6}\). The four corner triangles have legs 1 and 1, then 1 and 2, then 1 and 1, then 1 and 2, so their areas are \(\tfrac12\), \(1\), \(\tfrac12\) and \(1\), which add to 3. What is left is \({6 - 3 = 3}\).
By the formula. Here \({a = 1}\), \({b = 1}\), \({c = -1}\), \({d = 2}\), so
The two answers agree. Notice that \(c\) is negative here, so the box of Derivation 1 does not apply as drawn, yet the formula still holds, as Derivation 2 promised.
Using it. The triangle with corners \({(0, 0)}\), \({(4, 0)}\) and \({(0, 3)}\) has area \({\tfrac12 \cdot 4 \cdot 3 = 6}\). Under \(T\) its area must become \({3 \times 6 = 18}\). Check: its corners go to \({(0, 0)}\), \({T(4, 0) = (4, -4)}\) and \({T(0, 3) = (3, 6)}\). A triangle is half the parallelogram spanned by two of its sides, so its area is \({\tfrac12 \abs{4 \cdot 6 - 3 \cdot (-4)}} = {\tfrac12 \cdot 36} = 18\).
Code
First the formula itself, from scratch.
def det2(a, b, c, d):"""The determinant of the matrix with rows (a, b) and (c, d)."""return a * d - b * cprint("area factor of T:", det2(1, 1, -1, 2))print("triangle after T:", abs(det2(4, 3, -4, 6)) /2)
area factor of T: 3
triangle after T: 18.0
Now test the claim on a curved shape, without using the formula at all. Measure the disc of area 2 by counting small squares, exactly as in the figure, and measure its image the same way. A point \({(p, q)}\) belongs to the image when the point that \(T\) sends to it lies in the disc. Solving \({x + y = p}\) and \({-x + 2y = q}\) gives that point: add the equations to get \({y = (p + q)/3}\), then \({x = p - y} = {(2p - q)/3}\).
import mathdef measure(inside, lo, hi, h):"""Area of a region: count the squares of side h whose centre lies inside it.""" steps =round((hi - lo) / h) count =0for i inrange(steps):for j inrange(steps):if inside(lo + (i +0.5) * h, lo + (j +0.5) * h): count +=1return count * h * hR2 =2/ math.pi # the radius squared of a disc of area 2def in_disc(x, y):return x * x + y * y <= R2def in_image(p, q):"""Undo T, then ask whether that point was in the disc."""return in_disc((2* p - q) /3, (p + q) /3)before = measure(in_disc, -3, 3, 0.01)after = measure(in_image, -3, 3, 0.01)print(f"disc {before:.2f} its image {after:.2f} ratio {after / before:.2f}")
disc 2.00 its image 6.00 ratio 3.00
The count gives 2.00 and 6.00, with ratio 3.00, and no determinant was used. The library version is one call.
import numpy as npA = np.array([[1, 1], [-1, 2]])print(np.linalg.det(A))print(round(np.linalg.det(2* A) / np.linalg.det(A), 6))
3.0000000000000004
4.0
NumPy prints a number that differs from 3 only in the last decimal place or two. It does not use \({ad - bc}\). It uses the elimination method of lesson M02.8.4, in floating-point arithmetic, so compare its answers with np.isclose and never with ==. The second line confirms that doubling the matrix multiplies the determinant by 4.
Explore
This module’s interactive, the area explorer, lives in the next lesson, because its read-out also shows the sign of the determinant. If you would like to play now, the matrix playground already prints the area factor: press This module’s T and read off 3.
Pitfalls
M02.8.1-F5
Wrong beside right. Multiplying the two side lengths gives the area of a rectangle with those sides. The parallelogram leans, so its height is less than its second side.
“The area of the parallelogram is one side times the other.”
That is true only when the sides are at right angles. For \(T\) the sides have lengths \({\sqrt{2} \approx 1.41}\) and \({\sqrt{5} \approx 2.24}\), whose product is about 3.16, but the area is 3. Area is base times height, and \({ad - bc}\) computes exactly that.
“Twice the matrix, twice the area.”
\({\det(2\mat{A}) = 4 \det \mat{A}}\) for a 2 by 2 matrix, because both directions double. In \(n\) dimensions the factor is \(2^n\). This bites in machine learning, where \(n\) is large: scaling a 100 by 100 weight matrix by just 1.1 multiplies its volume factor by \(1.1^{100}\), which is about 13,800.
“The determinant says how much the map stretches lengths.”
It speaks about area only. A shear has determinant 1 and still lengthens most vectors. The stretch \(\begin{bmatrix} 4 & 0 \\ 0 & 0.25 \end{bmatrix}\) has determinant 1 too, yet it makes some vectors four times longer and others four times shorter.
“Every matrix has a determinant.”
Only square matrices do. A 2 by 3 matrix sends space to the plane, and there is no way to compare a volume with an area by a single factor.
Check yourself
Recall
1. What does the area factor of a linear map tell you?
Show answer
The number by which the map multiplies the area of every shape. It is the same for all shapes, wherever they are.
2. What is the determinant of \(\begin{bmatrix} a & b \\ c & d \end{bmatrix}\), and how is it related to the area factor?
Show answer
\({\det \mat{A} = ad - bc}\). The area factor is its absolute value, \({\abs{ad - bc}}\).
3. Why is it enough to know what the map does to the unit square?
Show answer
Every square, of any size and in any place, becomes a scaled and shifted copy of the same parallelogram, so it grows by the same factor. Any shape can be covered by small squares.
4. Which parallelogram has the area \({\abs{ad - bc}}\)?
Show answer
The one spanned by the columns \({(a, c)}\) and \({(b, d)}\) of the matrix: the image of the unit square.
5. The map \(T\) of this course has determinant 3. A shape of area 5 is put through \(T\). What is the area of its image?
Show answer
\({3 \times 5 = 15}\).
Exercises
1.★ Let \({\mat{M} = \begin{bmatrix} 3 & 1 \\ 2 & 4 \end{bmatrix}}\). Find \(\det \mat{M}\). A floor plan of area 12 is put through the map. What is the area of its image?
Show solution
\({\det \mat{M}} = {3 \cdot 4 - 1 \cdot 2} = 10\). Every area is multiplied by 10, so the image has area \({10 \times 12 = 120}\).
2.★★ Find the area of the triangle with corners \({P = (1, 1)}\), \({Q = (4, 2)}\) and \({R = (2, 5)}\).
Show solution
Shifting a shape does not change its area, so move \(P\) to the origin. Two sides of the triangle are then \({Q - P = (3, 1)}\) and \({R - P = (1, 4)}\). The parallelogram they span has area \({\abs{3 \cdot 4 - 1 \cdot 1} = 11}\), and the triangle is half of it: \(5.5\).
3.★★★ Show that adding a multiple of the first column of a 2 by 2 matrix to its second column does not change the determinant. Then say what this means in the picture.
Show solution
The new matrix is \({\begin{bmatrix} a & b + ka \\ c & d + kc \end{bmatrix}}\). Its determinant is
\[
\begin{aligned}
& a(d + kc) - (b + ka)c \\
&\quad = ad + akc - bc - kac \\
&\quad = ad - bc .
\end{aligned}
\]
In the picture, the second side of the parallelogram has been slid along the direction of the first. The base is the same and so is the height above it, so the area is the same. This is a shear of the parallelogram along its own base.
Summary card
A linear map multiplies every area by one number: the size of its determinant.
M02.8.1-F1
Every area, multiplied by 3.
Determinant.\({\det \begin{bmatrix} a & b \\ c & d \end{bmatrix}} = {ad - bc}\).
Area factor. The area of the image is \(\abs{\det \mat{A}}\) times the area of the shape.
Where it comes from.\({\abs{ad - bc}}\) is the area of the parallelogram spanned by the columns.
Scaling the matrix.\({\det(s\mat{A}) = s^2 \det \mat{A}}\) for a 2 by 2 matrix.
Sources and next steps
Sources. Each was opened and checked against this lesson on 12 November 2026.
Dan Margalit and Joseph Rabinoff, Interactive Linear Algebra, Section 4.3, Determinants and Volumes (open textbook). The theorem that the absolute value of the determinant is the volume of the parallelepiped, the area \({\abs{ad - bc}}\) of a parallelogram, and the theorem that a linear map scales the volume of any region by \(\abs{\det \mat{A}}\), argued by covering the region with small cubes. The book notes, as this lesson does, that the last step relies on calculus.
Grant Sanderson, The determinant, 3Blue1Brown, Linear Algebra, chapter 6. The determinant as the factor by which a linear map changes areas, with the two observations used in the build: what happens to one grid square happens to every other, and any shape can be approximated by grid squares.
Gilbert Strang, Cramer’s rule, inverse matrix, and volume, MIT OpenCourseWare 18.06SC, lecture summary. The area of a parallelogram with edges \({(a, b)}\) and \({(c, d)}\) is \({ad - bc}\), and the area of the triangle on the same edges is half of that.