Coordinate Geometry
Why This Matters
Imagine a town B that lies 36 km east and 15 km north of town A. How far apart are the two towns — in a straight line — without ever stretching a measuring tape across the countryside? Or: a phone company wants to place a relay tower on the road from A to B so that it sits twice as far from B as from A — exactly where on the map does it go?
These aren’t drawing-board puzzles. The moment you pin every point on a map to a pair of numbers (x, y), questions about distance and position become pure arithmetic. That is the whole power of coordinate geometry: it lets you study geometry using algebra. No protractor, no ruler — just the coordinates and a formula.
In this chapter you’ll build two tools that do exactly this. The distance formula tells you how far apart any two points are from their coordinates alone. The section formula tells you the coordinates of a point that splits a segment in a given ratio. Both come straight out of the geometry you already know — and we’ll prove them, not just hand them to you. With these two tools you can decide whether three points lie on a line, whether four points form a square, and where exactly a point divides a segment.
The Big Idea
Once each point is labelled with coordinates (x, y), geometry turns into algebra. The distance between two points is just the hypotenuse of a right triangle whose legs are the differences in their x- and y-coordinates — so d = √[(x₂ − x₁)² + (y₂ − y₁)²] straight from the Pythagoras theorem. And a point P that divides the segment from A to B in the ratio m : n has coordinates that are a weighted average of A’s and B’s — ((mx₂ + nx₁)/(m + n), (my₂ + ny₁)/(m + n)). The midpoint is simply the m = n case: the plain average.
Let’s Break It Down
Distances along an axis — the easy warm-up
Before the general formula, look at the simplest case. If two points lie on the x-axis, say A(4, 0) and B(6, 0), the distance is just the gap in their x-values: AB = 6 − 4 = 2 units. Likewise two points on the y-axis, say C(0, 3) and D(0, 8), are CD = 8 − 3 = 5 units apart.
So along a single axis, distance is just a subtraction. The interesting question is two points sitting anywhere in the plane — and that’s where Pythagoras comes in.
Deriving the distance formula
Take any two points P(x₁, y₁) and Q(x₂, y₂). Drop a perpendicular from P and from Q to the x-axis, and draw a horizontal line from P that meets the vertical through Q at a point T. Now PTQ is a right-angled triangle, with the right angle at T.
Read the two legs straight off the picture:
- The horizontal leg PT = x₂ − x₁ (the difference in x-coordinates).
- The vertical leg QT = y₂ − y₁ (the difference in y-coordinates).
Now apply the Pythagoras theorem to the right triangle PTQ:
PQ² = PT² + QT² = (x₂ − x₁)² + (y₂ − y₁)²
Since a distance is never negative, take only the positive square root:
PQ = √[(x₂ − x₁)² + (y₂ − y₁)²]
That is the distance formula. Two useful remarks:
- Because the differences get squared, it doesn’t matter which point you call “1” and which “2” — (x₂ − x₁)² = (x₁ − x₂)². You can subtract in either order.
- Putting one point at the origin O(0, 0) gives the distance of P(x, y) from the origin: OP = √(x² + y²).
Find the distance between A(2, 3) and B(4, 1).
- Label them: (x₁, y₁) = (2, 3) and (x₂, y₂) = (4, 1).
- Differences: x₂ − x₁ = 4 − 2 = 2, and y₂ − y₁ = 1 − 3 = −2.
- Square and add: 2² + (−2)² = 4 + 4 = 8.
- Take the positive root: AB = √8 = 2√2 units ≈ 2.83 units.
Town B is 36 km east and 15 km north of town A. How far is B from A in a straight line?
- Put A at the origin (0, 0). Then B is 36 east and 15 north, so B = (36, 15).
- Distance from the origin: OB = √(36² + 15²).
- Compute: 36² = 1296 and 15² = 225, so the sum is 1296 + 225 = 1521.
- √1521 = 39. So the two towns are 39 km apart — found without measuring a single metre.
Using distances: collinearity, triangles and quadrilaterals
Once you can find any distance, you can answer “what shape is this?” purely by comparing lengths.
Collinear points. Three points A, B, C lie on a single straight line exactly when the longest of the three distances equals the sum of the other two — e.g. AB + BC = AC. (If they made a triangle, any two sides would add up to more than the third; equality means the triangle has collapsed flat onto a line.)
Three students sit at A(3, 1), B(6, 4) and C(8, 6). Are they collinear?
- AB = √[(6 − 3)² + (4 − 1)²] = √(9 + 9) = √18 = 3√2.
- BC = √[(8 − 6)² + (6 − 4)²] = √(4 + 4) = √8 = 2√2.
- AC = √[(8 − 3)² + (6 − 1)²] = √(25 + 25) = √50 = 5√2.
- Check: AB + BC = 3√2 + 2√2 = 5√2 = AC. Since two distances add up to the third, the points are collinear — they sit in a line.
Types of triangle. Compute all three sides. All three equal → equilateral; exactly two equal → isosceles. And if the squares of two sides add up to the square of the third, the converse of the Pythagoras theorem says there’s a right angle there.
Types of quadrilateral. For four points (taken in order), compute the four sides and the two diagonals, then read off the shape:
| Shape | What to check |
|---|---|
| Square | all 4 sides equal AND both diagonals equal |
| Rhombus | all 4 sides equal BUT diagonals unequal |
| Rectangle | opposite sides equal AND both diagonals equal |
| Parallelogram | opposite sides equal (diagonals need not be) |
Show that A(1, 7), B(4, 2), C(−1, −1) and D(−4, 4) are the vertices of a square.
- The four sides: AB = √[(1 − 4)² + (7 − 2)²] = √(9 + 25) = √34; BC = √[(4 + 1)² + (2 + 1)²] = √(25 + 9) = √34.
- CD = √[(−1 + 4)² + (−1 − 4)²] = √(9 + 25) = √34; DA = √[(1 + 4)² + (7 − 4)²] = √(25 + 9) = √34. So all four sides equal √34.
- The diagonals: AC = √[(1 + 1)² + (7 + 1)²] = √(4 + 64) = √68; BD = √[(4 + 4)² + (2 − 4)²] = √(64 + 4) = √68. Both diagonals equal √68.
- All four sides are equal AND the two diagonals are equal — so ABCD is a square.
Deriving the section formula
Now the second tool. Suppose a point P(x, y) lies on the segment from A(x₁, y₁) to B(x₂, y₂) and divides it internally in the ratio m : n — meaning AP : PB = m : n.
Drop perpendiculars from A, P and B to the x-axis, and draw horizontal lines from A and from P. This creates two right triangles, AQP and PCB, sharing equal angles (the segment AB cuts across both at the same slope). By the AA similarity criterion, △AQP ~ △PCB.
From the similar triangles, corresponding sides are in the same ratio AP : PB = m : n, so:
AQ / PC = PQ / BC = m / n
Read those legs off the figure:
- AQ = x − x₁ and PC = x₂ − x.
- PQ = y − y₁ and BC = y₂ − y.
Take the x-part first: (x − x₁) / (x₂ − x) = m / n. Cross-multiply:
n(x − x₁) = m(x₂ − x) → nx − nx₁ = mx₂ − mx → mx + nx = mx₂ + nx₁ → x = (mx₂ + nx₁) / (m + n)
The y-part works identically: (y − y₁) / (y₂ − y) = m / n gives y = (my₂ + ny₁) / (m + n).
So the point P dividing AB internally in the ratio m : n is:
P = ((mx₂ + nx₁)/(m + n), (my₂ + ny₁)/(m + n))
This is the section formula. Notice the “cross” pattern: the x of the far point B gets multiplied by m (the first ratio number), and the x of the near point A by n.
The midpoint — just the m = n case
The midpoint divides a segment in the ratio 1 : 1, so put m = n = 1 in the section formula:
Midpoint = ((1·x₂ + 1·x₁)/(1 + 1), (1·y₂ + 1·y₁)/(1 + 1)) = ((x₁ + x₂)/2, (y₁ + y₂)/2)
In plain words: the midpoint’s coordinates are just the averages of the endpoints’ coordinates. No new formula to memorise — it falls right out of the section formula.
Find the point dividing the segment joining (4, −3) and (8, 5) internally in the ratio 3 : 1.
- Let A = (x₁, y₁) = (4, −3) and B = (x₂, y₂) = (8, 5), with m : n = 3 : 1.
- x = (mx₂ + nx₁)/(m + n) = (3·8 + 1·4)/(3 + 1) = (24 + 4)/4 = 28/4 = 7.
- y = (my₂ + ny₁)/(m + n) = (3·5 + 1·(−3))/(3 + 1) = (15 − 3)/4 = 12/4 = 3.
- So the required point is (7, 3).
In what ratio does the point (−4, 6) divide the segment joining A(−6, 10) and B(3, −8)?
- Let the ratio be k : 1 (write m : n as k : 1, dividing through by n). Then x = (k·3 + 1·(−6))/(k + 1) and we need this to equal −4.
- So (3k − 6)/(k + 1) = −4 → 3k − 6 = −4(k + 1) = −4k − 4.
- 3k + 4k = −4 + 6 → 7k = 2 → k = 2/7. So k : 1 = 2/7 : 1 = 2 : 7.
- Check the y-coordinate with ratio 2 : 7: y = (2·(−8) + 7·10)/(2 + 7) = (−16 + 70)/9 = 54/9 = 6 ✓. So (−4, 6) divides AB in the ratio 2 : 7.
What ratio must you use in the section formula to get the midpoint of a segment?
Common Mistakes
In the distance formula you add the differences, then square: d = √[(x₂ − x₁) + (y₂ − y₁)]².
Both forms have a square root over an expression with the same pieces, so it's easy to slide the squaring outside and 'simplify'.
You must square EACH difference separately and then add: d = √[(x₂ − x₁)² + (y₂ − y₁)²]. Squaring the sum gives a completely different (wrong) number — that's the Pythagoras structure leg² + leg², not (leg + leg)².
The order of the points changes the distance, so you must always do (bigger − smaller).
When you find a length 'by hand' you instinctively subtract small from big to keep it positive, so the order feels like it matters.
Because each difference is SQUARED, (x₂ − x₁)² = (x₁ − x₂)². Subtract in whichever order you like — the squares erase the sign, so the distance is the same either way.
In the section formula for ratio m : n, multiply x₁ by m and x₂ by n: x = (mx₁ + nx₂)/(m + n).
It feels natural to pair the first ratio number m with the first point A, keeping everything 'in order'.
It's CROSSED: the first ratio number m goes with the FAR point B, the second number n with the NEAR point A. So x = (mx₂ + nx₁)/(m + n). A quick sanity check: a 3 : 1 split lands the point closer to B, so B should carry the bigger weight (3).
To find the midpoint you average the x with the y: midpoint = ((x₁ + y₁)/2, (x₂ + y₂)/2).
There are lots of subscripts and two halves, so it's easy to mix up which numbers get paired.
Keep x's with x's and y's with y's: midpoint = ((x₁ + x₂)/2, (y₁ + y₂)/2). The first coordinate averages the two x-values; the second averages the two y-values.
Quick Check
What is the distance between the points (0, 0) and (5, 12)?
Three points satisfy AB + BC = AC. What does this tell you?
What is the midpoint of the segment joining (−2, 4) and (6, −2)?
A point divides the segment from A(0, 0) to B(8, 0) in the ratio 3 : 1. What is its x-coordinate?
Practice Problems
Easy
Find the distance between (−5, 7) and (−1, 3).
Differences: x₂ − x₁ = −1 − (−5) = 4, and y₂ − y₁ = 3 − 7 = −4.
Distance = √[4² + (−4)²] = √(16 + 16) = √32 = 4√2 units (≈ 5.66 units).
Find the midpoint of the segment joining (3, 0) and (3, 8).
Average each coordinate: x = (3 + 3)/2 = 3 and y = (0 + 8)/2 = 4.
So the midpoint is (3, 4). (Both points share x = 3, so the midpoint must too — a good sanity check.)
Medium
Find the coordinates of the points of trisection of the segment joining A(2, −2) and B(−7, 4) — the two points that divide it into three equal parts.
Call the trisection points P (nearer A) and Q (nearer B), so AP = PQ = QB.
P divides AB in the ratio 1 : 2. Using the section formula with m : n = 1 : 2:
x = (1·(−7) + 2·2)/(1 + 2) = (−7 + 4)/3 = −3/3 = −1.
y = (1·4 + 2·(−2))/(1 + 2) = (4 − 4)/3 = 0. So P = (−1, 0).
Q divides AB in the ratio 2 : 1. With m : n = 2 : 1:
x = (2·(−7) + 1·2)/(2 + 1) = (−14 + 2)/3 = −12/3 = −4.
y = (2·4 + 1·(−2))/(2 + 1) = (8 − 2)/3 = 6/3 = 2. So Q = (−4, 2).
The points of trisection are (−1, 0) and (−4, 2).
Find a point on the y-axis that is equidistant from A(6, 5) and B(−4, 3).
Any point on the y-axis has the form P(0, y). We want PA = PB, so PA² = PB²:
(6 − 0)² + (5 − y)² = (−4 − 0)² + (3 − y)²
36 + 25 − 10y + y² = 16 + 9 − 6y + y²
61 − 10y = 25 − 6y → 61 − 25 = 10y − 6y → 36 = 4y → y = 9.
So the required point is (0, 9). (Check: PA = √(6² + (5 − 9)²) = √(36 + 16) = √52, and PB = √((−4)² + (3 − 9)²) = √(16 + 36) = √52 ✓.)
Challenge
A(6, 1), B(8, 2), C(9, 4) and D(p, 3) are the vertices of a parallelogram, taken in order. Find p.
A key property: the diagonals of a parallelogram bisect each other, so the midpoint of diagonal AC equals the midpoint of diagonal BD.
Midpoint of AC = ((6 + 9)/2, (1 + 4)/2) = (15/2, 5/2).
Midpoint of BD = ((8 + p)/2, (2 + 3)/2) = ((8 + p)/2, 5/2).
The y-coordinates already match (5/2 = 5/2 ✓). Match the x-coordinates:
15/2 = (8 + p)/2 → 15 = 8 + p → p = 7.
Find the ratio in which the y-axis divides the segment joining (5, −6) and (−1, −4), and find the point of division.
Let the ratio be k : 1. The x-coordinate of the dividing point is
x = (k·(−1) + 1·5)/(k + 1) = (−k + 5)/(k + 1).
On the y-axis the x-coordinate is 0, so set (−k + 5)/(k + 1) = 0 → −k + 5 = 0 → k = 5.
So the ratio is 5 : 1. Now find y at k = 5:
y = (5·(−4) + 1·(−6))/(5 + 1) = (−20 − 6)/6 = −26/6 = −13/3.
The point of intersection is (0, −13/3).
Summary
You should now be able to explain:
- Coordinate geometry turns geometric questions about points into algebra, using their coordinates (x, y).
- The distance formula: PQ = √[(x₂ − x₁)² + (y₂ − y₁)²], derived from the Pythagoras theorem on the right triangle with legs x₂ − x₁ and y₂ − y₁. The order of subtraction doesn’t matter because the differences are squared.
- The distance from the origin: OP = √(x² + y²).
- Collinearity: three points lie on a line when the largest distance equals the sum of the other two (AB + BC = AC).
- You can classify triangles and quadrilaterals by comparing side lengths and diagonals (square, rhombus, rectangle, parallelogram).
- The section formula: a point dividing AB internally in ratio m : n is ((mx₂ + nx₁)/(m + n), (my₂ + ny₁)/(m + n)) — derived from similar triangles, with the ratio numbers crossed onto the opposite endpoints.
- The midpoint formula is the m = n = 1 case: ((x₁ + x₂)/2, (y₁ + y₂)/2) — just the average of the coordinates.
What’s Next
So far you’ve described positions and distances with coordinates. Next, in Introduction to Trigonometry, you’ll connect the angles of a right triangle to the ratios of its sides — sine, cosine and tangent. Where coordinate geometry measures how far, trigonometry measures which direction, and together they power everything from measuring the height of a tower to navigation and physics.