Stand at the Nyatapola in Bhaktapur. How far is Kathmandu Durbar Square, in a straight line? The road bends, and nobody can walk through the houses, so you can’t measure it by going there.
A grid turns the question into arithmetic. The Nyatapola is 12.0 km east of the square and 3.6 km south. Those two numbers, and a right-angled triangle, are all you need.
This unit gives you one formula that finds the straight-line distance between any two points on a grid. By Back to the map you will have the answer, and you will know why it is right.
17.0 Review
Start with a game for two players. You need a red die, a blue die and a graph board.
Sometimes you can see which line is longer. Often you can’t, as the sample round shows: a line 5 squares long and a slanting one that goes 3 across and 4 up are exactly equal. By the end of 17.1 you will be able to work that out from the two points alone, with no ruler.
The game used a numbered grid. Now let the numbers run in both directions from a middle point, as in Figure 17.2.
The point O, where the axes cross, is the origin. Every point’s position is measured from it with two numbers. In A(−3, 2), the first number, −3, is the x-coordinate: how far across, right if positive, left if negative. The second number, 2, is the y-coordinate: how far up, up if positive, down if negative. A pair like this, where the order matters, is an ordered pair.
The axes cut the plane into four quarters, the quadrants. The signs of a point’s coordinates tell you which one it is in.
| Quadrant | Where | Signs |
|---|---|---|
| First | right, up | (+, +) |
| Second | left, up | (−, +) |
| Third | left, down | (−, −) |
| Fourth | right, down | (+, −) |
Now look at points on the axes themselves. Walk along the X-axis and you never go up or down, so every point on it has y = 0: (3, 0), (−8, 0). Walk along the Y-axis and you never go across, so every point on it has x = 0: (0, 6), (0, −2). The origin is on both.
Where is the point (0, −7)?
Pick an answer to see why.
17.1 Distance between two points
Two points level with each other are easy. From (2, 3) to (7, 3), count squares or subtract: 7 − 2 = 5 units. The same goes for two points one above the other. The trouble starts when the line slants, because then it runs across the squares and you can’t count it.
But a slanting line is never alone. Go across from one end and up to the other, and you have drawn a right-angled triangle with the slanting line as its longest side. That is where Pythagoras’ theorem comes in.
The distance formula: the distance between A(x₁, y₁) and B(x₂, y₂) is
Read it in words: square the difference across, square the difference up, add them, and take the square root. It is Pythagoras’ theorem with the two short sides found by subtracting.
Two things show up when you play with it.
It doesn’t matter which point you call first. Swap A and B and each difference changes sign, but . Squaring takes the sign away, and a distance is never negative.
Negative coordinates need care. From x = −2 to x = 3 is 5 units, and the formula agrees: 3 − (−2) = 3 + 2 = 5. Write the brackets, and the signs look after themselves.
What is the distance between (1, 2) and (4, 6)?
Pick an answer to see why.
Pythagoras’ theorem, the two ways round
The formula rests on Pythagoras’ theorem, so use it first on plain triangles. In a right-angled triangle, the side opposite the right angle is the hypotenuse (h), always the longest. The other two are the perpendicular (p) and the base (b), and
The theorem also works backwards. If the squares of a triangle’s two shorter sides add up to the square of its longest side, the triangle is right-angled. If they don’t, it isn’t, however right-angled it looks. So you can test a corner with no protractor, using only lengths.
Which of these can be the sides of a right-angled triangle?
Pick an answer to see why.
Using the formula
A circle is every point at one distance from its center. So “is this point on the circle?” is really a question about distance. Try it.
Naming a shape from its corners
Give the corners of a shape and the distance formula can tell you what it is. Find every side, then compare them. An isosceles triangle has two equal sides, and a rhombus has four. A rectangle has its opposite sides equal and its diagonals equal.
Finding a coordinate
The formula can also run backwards, when you know the distance and one coordinate is missing.
Back to the map
Now the opening question. Put Kathmandu Durbar Square at (0, 0) and the Nyatapola at (12.0, −3.6), in kilometers:
The Nyatapola is about 12.5 km from Kathmandu Durbar Square in a straight line. The road is longer, because it isn’t straight.
The grid gives the rest too. Patan is at (1.8, −3.4), so it is about 10.2 km from the Nyatapola. Boudhanath at (5.5, 1.9) is about 6.5 km from Changu Narayan at (12.0, 1.3). And Changu Narayan is almost exactly north of the Nyatapola, both at 12.0 km east on the grid, so that distance needs only a subtraction: 1.3 − (−3.6) = 4.9 km. Before rounding it is 5.0 km, because each position here is rounded to one decimal.
Where this is used
- Maps. “As the crow flies” is the straight-line distance. A map app that shows it for two nearby places is doing this calculation, or the same thing on a curved Earth.
- Video games. A game must keep checking whether two things have touched. Some use circles round each object, called hitboxes. Two circles touch or overlap when the distance between their centers is no more than their two radii added together. So a ball of radius 4 at (3, 1) and one of radius 10 at (8, 13) have hit: their centers are 13 apart, less than 4 + 10 = 14.
- GPS. Your phone works out its position from signals of at least four satellites: three numbers for where it is, and a fourth for its clock’s error. A distance in space uses the same formula with a third difference inside the root.
- Chess. A knight moves 2 squares one way and 1 the other, so every knight’s move is the same straight-line length, squares, in all eight directions.
How the exam asks it
The grid’s Grade 8 model paper has no question on distance, so this one is ours. It starts as the Grade 7 model paper’s question does, then goes on, with the marks shared the way a teacher might. Read it as practice, not a prediction. Cover the answer and try it.
Where marks are lost
- Swapping the coordinates, or the axes: x = 0 is the Y-axis.
- Losing a sign: 3 − (−1) is 4, not 2.
- Taking a side that isn’t the longest as h.
- Forgetting the square root at the end, or adding the differences before squaring.
- Finding only some of the sides before naming a shape.
Exercise 17.1
Question 1
Use Pythagoras’ theorem to find out whether each triangle is right-angled. The triangles are drawn to scale.
Sides , and 4.
Answer
Sides , 3 and .
Answer
Sides 4, 11 and 12.
Answer
Sides 5, 5 and .
Answer
Sides 9, 12 and 15.
Answer
Sides 5, 6 and 7.
Answer
Question 2
Find the value of x in each right-angled triangle.
Answer
Answer
Answer
Answer
Answer
Answer
Answer
Answer
Answer
Question 3
Find the distance between the two ends of each line on the graph.
Hint
Answer
Question 4
Find the distance between the two points.
(4, −7) and (−1, 5)
Answer
(−3, 4) and (4, 3)
Answer
(1, −2) and (5, −6)
Answer
(1, 7) and (1, 1)
Answer
(2, 7) and (4, 9)
Answer
(−8, 7) and (−3, 4)
Answer
Question 5
The point A is where a line meets the X-axis at −8, and B is where it meets the Y-axis at 6. Find the distance AB.
Hint
Answer
Question 6
The positions of a cat and a mouse are shown on the graph paper. Find their coordinates and the distance between them.
Answer
Question 7
Prove that the points A(−4, 0), B(−4, −4), C(2, −4) and D(2, 0) are the vertices of a rectangle.
Hint
Answer
Question 8
On a map, the coordinates of A and B are (4, 7) and (7, 3). What is the distance between them on the map? If 1 unit is 55 km, find the actual distance between A and B.
Answer
Question 9
Prove that the points P(1, 6), Q(4, 1) and R(−4, 3) are the vertices of an isosceles triangle.
Answer
Question 10
The points A(2, −1), B(3, 4), C(−2, 3) and D(−3, −2) are the vertices of a rhombus ABCD. Find the lengths of its diagonals AC and BD.
Answer
Question 11
The point P(9, 12) is on the circumference of a circle with center Q(1, 6). What is the radius of the circle? Does the point (−7, 0) lie on the circumference?
The textbook prints both P and Q as points on the circumference, but those numbers don’t work: many circles of different sizes pass through two points, so no radius can be found. Its Nepali edition makes Q the center, and that is the question here.
Answer
Question 12
Find the distance from the origin O to the points A(−7, 7) and B(7, −7).
Answer
Question 13
The distance between P(0, 6) and Q(a, 0) is 6 units. What is the value of a?
Answer
Printable PDFs
- Study notes 2 pages
- Harder practice questions 1 page Answer key
Practice every question in the book, and keep track of the ones you miss →
Where these facts come from
- The exam (For the exam, How the exam asks it): CDC, विशिष्टीकरण तालिका (कक्षा ६-८) गणित – नमुना प्रश्नहरु (Geometry 15 marks in three questions; the Grade 8 model paper has no distance question; the Grade 7 model paper’s question 10a; the note that a paper covers each area’s topics in proportion); our question is our own.
- The common mistakes (careful boxes, Where marks are lost): CDC, शिक्षक निर्देशिका कक्षा ८ गणित (२०८१), the lesson on coordinates (mixing up the points of the X-axis and the Y-axis; taking the longest side as the hypotenuse).
- The opening and Back to the map: latitudes and longitudes from Wikipedia’s articles on Kathmandu Durbar Square, Patan Durbar Square, Boudhanath, Changu Narayan Temple and Nyatapola, read November 2026, turned into kilometers east and north of the square; the straight-line distance on the sphere is 12.57 km.
- The Nyatapola, built in 1702: Wikipedia, “Nyatapola”, read November 2026.
- The history of the formula (story in 17.1): Wikipedia, “Euclidean distance” (distance as a number isn’t in Euclid’s Elements; Descartes 1637; Clairaut 1731; distances on the Earth’s surface aren’t Euclidean), and “Euclid’s Elements” (about 300 BC), read November 2026.
- Plimpton 322 and Pythagorean triples: Wikipedia, “Plimpton 322” and “Pythagorean triple”, read November 2026.
- Taxicab distance: Wikipedia, “Taxicab geometry”, read November 2026.
- Video games: Wikipedia, “Collision detection” (rectangles or circles called hitboxes), read November 2026.
- The chess knight: Wikipedia, “Knight (chess)” (two squares one way and one the other), read November 2026.
- GPS: Wikipedia, “Global Positioning System” (at least four satellites: three coordinates and the receiver’s clock), and “Euclidean distance” (the formula in three dimensions), read November 2026.
- Every answer: worked out here and checked by a computer algebra program (SymPy).
A companion to your textbook, not a replacement for it: study from the book your school uses, and where the two differ, follow your teacher. Found a mistake? Please tell us.
