Coordinate Geometry
Why This Matters
Imagine a town B. It is 36 km east of town A and 15 km north of it. How far apart are the two towns if you go in a straight line? Could you find this without dragging a measuring tape across the fields? Here is another one. A phone company wants to put a tower on the road from A to B. The tower must sit twice as far from B as from A. Where exactly on the map does it go?
These are not just puzzles on paper. Think about how a map works. Every place gets a pair of numbers (x, y). Once you do that, questions about distance (how far apart) and position (where something is) turn into simple arithmetic. That is the whole power of coordinate geometry. It lets you study shapes and points using algebra. You don’t need a protractor or a ruler. You just need the coordinates and a formula.
In this chapter you’ll build two tools. The first is the distance formula. It tells you how far apart two points are, using only their coordinates. The second is the section formula. It tells you the coordinates of a point that splits a line segment in a given ratio. We won’t just hand these formulas to you. We will prove both of them, starting from geometry you already know. With these two tools you can check whether three points lie on one line, whether four points form a square, and where exactly a point cuts a segment.
The Big Idea
Once you give each point coordinates (x, y), geometry becomes algebra. To find the distance between two points, draw a right triangle. Its two short sides are the gap in the x-values and the gap in the y-values. The distance is the longest side (the hypotenuse). So d = √[(x₂ − x₁)² + (y₂ − y₁)²], straight from the Pythagoras theorem. For the section formula, take a point P that splits the segment from A to B in the ratio m : n. Its coordinates are a kind of weighted average of A’s and B’s: ((mx₂ + nx₁)/(m + n), (my₂ + ny₁)/(m + n)). The midpoint is just the special case where m = n. Then it is the plain average.
Let’s Break It Down
The coordinate plane — where every point gets a name
Everything in this chapter sits on the coordinate plane. This is just two number lines that cross each other at right angles. The horizontal one is the x-axis. The vertical one is the y-axis. They meet at a point called the origin O, which is the point (0, 0). Now every point gets a name: an ordered pair (x, y). The first number tells you how far to go across (left or right along x). The second number tells you how far to go up or down (along y). For example, to plot the point (3, 2), you go 3 steps right, then 2 steps up.
The two axes cut the plane into four parts called quadrants. We number them 1, 2, 3, 4, going anticlockwise and starting from the top-right. Each quadrant has its own pattern of plus and minus signs. This is a handy way to catch mistakes. If your answer puts a point in the wrong quadrant, you know something has gone wrong. Figure 7.1 below shows the axes, the four quadrants with their sign patterns, and how the point P(3, 2) is plotted.
Distances along an axis — the easy warm-up
Before we get to the full formula, let’s look at the easiest case. Suppose two points both lie on the x-axis, like A(4, 0) and B(6, 0). The distance between them is just the gap in their x-values: AB = 6 − 4 = 2 units. The same idea works on the y-axis. Take C(0, 3) and D(0, 8). The distance is CD = 8 − 3 = 5 units.
So when two points are on the same axis, distance is simply a subtraction. The real question is what to do when the two points are sitting anywhere in the plane, not on the same line. That is where the Pythagoras theorem helps us.
Deriving the distance formula
The whole formula leans on one rule you’ve met before. Let’s quickly refresh it before we put it to work.
Take any two points P(x₁, y₁) and Q(x₂, y₂). Draw a straight line down from P to the x-axis, and another straight line down from Q to the x-axis. Now draw a flat horizontal line starting at P. Extend it until it hits the vertical line coming down from Q. Call that meeting point T. Look at the triangle PTQ. The corner at T is a perfect right angle (90°), so PTQ is a right-angled triangle. Figure 7.2 below shows this triangle, with the two legs and the hypotenuse d labelled.
The two short sides (the legs) of this triangle are easy to read off the picture:
- The flat side PT = x₂ − x₁ (the gap between the x-coordinates).
- The upright side QT = y₂ − y₁ (the gap between the y-coordinates).
The Pythagoras theorem says: in a right triangle, (longest side)² = (one leg)² + (other leg)². Here PQ is the longest side. So:
PQ² = PT² + QT² = (x₂ − x₁)² + (y₂ − y₁)²
A distance can never be negative, so we take only the positive square root:
PQ = √[(x₂ − x₁)² + (y₂ − y₁)²]
That is the distance formula. Two things worth noticing:
- Each gap gets squared. So it does not matter which point you call point 1 and which you call point 2. For example, (x₂ − x₁)² = (x₁ − x₂)², because squaring a negative number makes it positive. You can subtract in either order and get the same answer.
- What if one point is the origin O(0, 0)? Then x₁ = 0 and y₁ = 0, and the formula becomes the distance of P(x, y) from the origin: OP = √(x² + y²).
Let’s see the formula in action on two simple points before anything trickier.
Find the distance between A(2, 3) and B(4, 1).
- First, name the coordinates: (x₁, y₁) = (2, 3) and (x₂, y₂) = (4, 1).
- Find the two gaps: x₂ − x₁ = 4 − 2 = 2, and y₂ − y₁ = 1 − 3 = −2.
- Square each gap and add them: 2² + (−2)² = 4 + 4 = 8.
- Take the positive square root: AB = √8 = 2√2 units, which is about 2.83 units.
Now let’s settle the town puzzle we opened the chapter with — the same formula does the job.
Town B is 36 km east and 15 km north of town A. How far is B from A in a straight line?
- Put town A at the origin (0, 0). B is 36 km east and 15 km north of A, so B = (36, 15).
- Since A is the origin, use the distance-from-origin formula: OB = √(36² + 15²).
- Work it out: 36² = 1296 and 15² = 225. Add them: 1296 + 225 = 1521.
- √1521 = 39. So the two towns are 39 km apart, and we found it without measuring a single metre.
Using distances: collinearity, triangles and quadrilaterals
Once you can find any distance, you can answer “what shape is this?” just by comparing lengths.
Collinear points. “Collinear” simply means lying on one straight line. Three points A, B, C are collinear exactly when the longest of the three distances equals the sum of the other two. For example, AB + BC = AC. Why does this work? If the three points made a real triangle, then any two sides would always add up to more than the third side. So when two of the distances add up to exactly the third, the triangle has flattened out into a straight line. Figure 7.3 below shows both cases side by side: points on a line, and points forming a triangle.
Let’s try this distance test on three actual points and see if they line up.
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.
- Now check: AB + BC = 3√2 + 2√2 = 5√2, and this equals AC. Two distances add up to exactly the third one, so the three points are collinear. They all sit on one straight line.
Types of triangle. Find all three side lengths. If all three are equal, the triangle is equilateral. If exactly two are equal, it is isosceles. And there is one more check: if the squares of two sides add up to the square of the third side, then those two sides meet at a right angle. This is the converse of the Pythagoras theorem (the theorem read backwards). We saw earlier that a 90° corner forces leg² + leg² = hypotenuse². The converse says the reverse is also true: if you find that two sides squared add up to the third side squared, the corner between them must be 90°. No other angle can make those numbers fit. So the equation itself is proof of a right angle.
Types of quadrilateral. A quadrilateral is any four-sided shape. Take the four points in order around the shape. Find the four side lengths and the two diagonals (the lines joining opposite corners). Then use this table to name 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) |
You might wonder why the diagonals matter at all. If a shape already has all four sides equal, isn’t that enough to call it a square? No — and this is exactly where students lose marks. A rhombus also has all four sides equal. Picture a square that you push sideways so it leans over, like a squashed cardboard box. The four sides stay the same length, but the corners are no longer square (90°). That tilted shape is a rhombus, not a square. So “four equal sides” cannot, on its own, tell a square apart from a rhombus.
The diagonals are what break the tie. In a square the two diagonals come out equal. In a leaning rhombus one diagonal stretches long while the other shrinks short, so they are unequal. (In fact, the diagonals come out equal only when the corners are true 90° corners — so equal diagonals are a secret way of checking for square corners without measuring any angle.) That is why the square test needs both equal sides and equal diagonals. Figure 7.4 below shows the two shapes side by side.
Let’s put the table to work on four points and prove what shape they make.
Show that A(1, 7), B(4, 2), C(−1, −1) and D(−4, 4) are the vertices of a square.
- First find the four sides. AB = √[(1 − 4)² + (7 − 2)²] = √(9 + 25) = √34. BC = √[(4 + 1)² + (2 + 1)²] = √(25 + 9) = √34.
- Now the other two sides. CD = √[(−1 + 4)² + (−1 − 4)²] = √(9 + 25) = √34. DA = √[(1 + 4)² + (7 − 4)²] = √(25 + 9) = √34. So all four sides equal √34.
- Next find the two 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 both diagonals are equal. From the table, that means ABCD is a square.
Deriving the section formula
Now for the second tool. Suppose a point P(x, y) sits on the segment from A(x₁, y₁) to B(x₂, y₂). It divides the segment in the ratio m : n. “Divides internally in the ratio m : n” just means the part AP and the part PB are in the ratio m : n. In short, AP : PB = m : n. For example, a ratio of 3 : 1 means AP is three times as long as PB.
Now draw straight lines down from A, P and B to the x-axis. Then draw a flat horizontal line from A and another from P. This makes two right triangles, AQP and PCB. These two triangles have the same set of angles, because the segment AB crosses both of them at the same slant. When two triangles have the same angles, they have the same shape (one is just a bigger or smaller copy of the other). We call such triangles similar. This is the AA similarity criterion (AA means “angle-angle”). So △AQP ~ △PCB.
Similar triangles are the engine of this proof, so let’s make sure that idea is solid first.
Figure 7.5 below shows those two similar triangles drawn under the segment, so you can see exactly which sides we’ll compare.
In similar triangles, matching sides are in the same ratio. That ratio here is AP : PB = m : n. So:
AQ / PC = PQ / BC = m / n
Read these sides off the figure:
- AQ = x − x₁ and PC = x₂ − x.
- PQ = y − y₁ and BC = y₂ − y.
Let’s do the x-part first. We have (x − x₁) / (x₂ − x) = m / n. Cross-multiply (multiply each side’s top by the other side’s bottom):
n(x − x₁) = m(x₂ − x)
Open the brackets: nx − nx₁ = mx₂ − mx. Bring the x-terms to one side: mx + nx = mx₂ + nx₁. Take x common on the left: (m + n)x = mx₂ + nx₁. So:
x = (mx₂ + nx₁) / (m + n)
The y-part works in exactly the same way. From (y − y₁) / (y₂ − y) = m / n we get y = (my₂ + ny₁) / (m + n).
So the point P that divides AB in the ratio m : n is:
P = ((mx₂ + nx₁)/(m + n), (my₂ + ny₁)/(m + n))
This is the section formula. Watch the “cross” pattern here. The first ratio number m gets multiplied by the far point B (its x₂ and y₂). The second ratio number n gets multiplied by the near point A (its x₁ and y₁). The numbers cross over to the opposite point.
The midpoint — just the m = n case
The midpoint is the exact middle of a segment. It splits the segment into two equal halves, so the ratio is 1 : 1. Put m = 1 and n = 1 into 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: to find the midpoint, just take the average of the two x-values and the average of the two y-values. There is no new formula to memorise here. It comes straight out of the section formula.
Let’s run the section formula on a real 3 : 1 split and watch the crossed pattern do its work.
Find the point dividing the segment joining (4, −3) and (8, 5) internally in the ratio 3 : 1.
- Name the points and the ratio: A = (x₁, y₁) = (4, −3), B = (x₂, y₂) = (8, 5), and m : n = 3 : 1. So m = 3 and n = 1.
- Find x using the formula: x = (mx₂ + nx₁)/(m + n) = (3·8 + 1·4)/(3 + 1) = (24 + 4)/4 = 28/4 = 7.
- Find y the same way: y = (my₂ + ny₁)/(m + n) = (3·5 + 1·(−3))/(3 + 1) = (15 − 3)/4 = 12/4 = 3.
- So the point we want is (7, 3).
We can also run the formula backwards: given the dividing point, find the unknown ratio.
In what ratio does the point (−4, 6) divide the segment joining A(−6, 10) and B(3, −8)?
- We don’t know the ratio, so let it be k : 1. (Any ratio m : n can be written as k : 1 by dividing both numbers by n.) Put this into the x-formula: x = (k·3 + 1·(−6))/(k + 1). We are told this point’s x is −4, so set the formula equal to −4.
- So (3k − 6)/(k + 1) = −4. Cross-multiply: 3k − 6 = −4(k + 1) = −4k − 4.
- Bring the k-terms together: 3k + 4k = −4 + 6, so 7k = 2, which gives k = 2/7. So the ratio k : 1 = 2/7 : 1. Multiply both sides by 7 to clear the fraction: 2 : 7.
- Let’s check with the y-coordinate, using ratio 2 : 7: y = (2·(−8) + 7·10)/(2 + 7) = (−16 + 70)/9 = 54/9 = 6 ✓. This matches the given y. So (−4, 6) divides AB in the ratio 2 : 7.
Before moving on, here’s a quick one to make sure the midpoint-as-special-case idea stuck.
What ratio must you use in the section formula to get the midpoint of a segment?
Common Mistakes
These two formulas trip up almost everyone in the same few spots. Here are the slip-ups to watch for so you don’t lose easy marks.
In the distance formula you add the two gaps first, then square the whole thing: d = √[(x₂ − x₁) + (y₂ − y₁)]².
Both versions use the same pieces under a square root, so it feels okay to pull the squaring outside and 'tidy up'.
You must square EACH gap on its own, and then add: d = √[(x₂ − x₁)² + (y₂ − y₁)²]. Squaring the sum gives a totally different (wrong) answer. Remember the Pythagoras shape is leg² + leg², not (leg + leg)².
The order of the points matters, so you must always do (bigger − smaller) to keep things positive.
When you measure a length by hand, you naturally take small from big so the answer is not negative. So the order feels important.
Because each gap is SQUARED, (x₂ − x₁)² = (x₁ − x₂)². Squaring turns any minus sign into a plus. So you can subtract in any order and the distance comes out the same.
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.
Trisecting a segment means cutting it into three equal parts. Call the two cut points P (nearer A) and Q (nearer B), so AP = PQ = QB.
P divides AB in the ratio 1 : 2. (P leaves 1 part behind it and 2 parts ahead.) Use 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).
Every point on the y-axis has x = 0, so it looks like P(0, y). We need PA = PB. To avoid square roots, square both sides: 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.
Use a key property: the diagonals of a parallelogram bisect each other (each diagonal cuts the other exactly in half). So both diagonals share the same midpoint. That means the midpoint of diagonal AC must equal 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).
The dividing point is on the y-axis, so its x-coordinate must be 0. Set the fraction to 0. A fraction is 0 only when its top is 0: −k + 5 = 0, so 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 used coordinates to describe positions and distances. Next, in Introduction to Trigonometry, you’ll link the angles of a right triangle to the ratios of its sides. These ratios are called sine, cosine and tangent. Think of it this way: coordinate geometry tells you how far, while trigonometry tells you which direction. Put together, they let you do amazing things, from finding the height of a tall tower to navigation and physics.
Frequently Asked Questions
How do you derive the distance formula in coordinate geometry?
Take two points A(x₁, y₁) and B(x₂, y₂). Draw a right-angled triangle by going across from A and then up to B. The horizontal side has length |x₂ − x₁| and the vertical side has length |y₂ − y₁|. By the Pythagoras theorem, AB² = (x₂ − x₁)² + (y₂ − y₁)², so AB = √[(x₂ − x₁)² + (y₂ − y₁)²].
What is the section formula and how do you use it?
If a point P divides the line segment joining A(x₁, y₁) and B(x₂, y₂) in the ratio m : n, then P has coordinates ((mx₂ + nx₁)/(m + n), (my₂ + ny₁)/(m + n)). Think of it as a weighted average — the point closer to B gets a bigger pull from B's coordinates. The midpoint is the special case where m = n, giving ((x₁ + x₂)/2, (y₁ + y₂)/2).
How do you check if three points are collinear using coordinate geometry?
Three points are collinear (on one straight line) if the area of the triangle formed by them is zero. Use the formula: Area = ½ |x₁(y₂ − y₃) + x₂(y₃ − y₁) + x₃(y₁ − y₂)|. If this equals 0, the points are collinear. Alternatively, check if the distance AB + BC equals AC (the three distances rule).
How do you find what type of quadrilateral four points form?
Calculate the lengths of all four sides and both diagonals using the distance formula. A parallelogram has two pairs of equal opposite sides. A rectangle is a parallelogram with equal diagonals. A rhombus is a parallelogram with all four sides equal. A square is a rhombus with equal diagonals. Comparing these lengths tells you exactly which shape it is.
What is the distance of a point from the origin, and how is it calculated?
The origin is the point (0, 0). The distance of any point P(x, y) from the origin is √(x² + y²), which comes directly from the distance formula with x₁ = 0 and y₁ = 0. For example, the distance of the point (3, 4) from the origin is √(9 + 16) = √25 = 5.