7.1 The Distance Formula
Describe every point by two numbers and the straight-line distance between any two points follows from Pythagoras: $d=\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}$. With one formula you can measure a map, test whether three points lie on a line, and recognise a square from its corners.
At the start of this chapter a flag stood at $(24, 7)$ on the school ground, and we found its distance from the corner flag with Pythagoras: $\sqrt{24^2+7^2}=25$ m. The same trick works for any two flags, not only for flags measured from the corner. If one flag is at $(3, 2)$ and another at $(11, 8)$, then the second is $8$ m further along and $6$ m further up, and the straight line between them is the hypotenuse of a right-angled triangle with sides $8$ and $6$. Its length is $\sqrt{64+36}=10$ m.
In this section we turn that picture into a formula, the distance formula, and prove it. Then we use it for three jobs a Class 10 student meets again and again: finding a missing coordinate when a distance is given, deciding whether three points lie on one straight line, and deciding whether a triangle or a quadrilateral is isosceles, right-angled, a square, a rectangle or a rhombus. Everything is done with distances โ no protractor, no ruler.
Points, axes and distances along a line
You met the Cartesian plane in Class 9. Two perpendicular number lines cross at a point called the origin; the horizontal one is the $x$-axis and the vertical one is the $y$-axis. Any point is described by an ordered pair of numbers, and the order matters: $(3, 5)$ and $(5, 3)$ are different points.
The easiest distances need no formula. If two points have the same ordinate, they lie on a horizontal line and the distance is just the difference of the abscissas, taken positive: the distance from $(-4, 5)$ to $(7, 5)$ is $|7-(-4)|=11$. Likewise two points with the same abscissa lie on a vertical line and the distance is the difference of the ordinates. Notice the double minus in $7-(-4)$: distance along a number line is always "larger minus smaller", never $7-4$.
The distance formula
Now take two points that are not on a horizontal or a vertical line. Draw the horizontal line through one and the vertical line through the other; they meet in a corner point, and a right-angled triangle appears with the segment as its hypotenuse. Its legs are horizontal and vertical, so their lengths are the easy distances above.
Proof. Through $P$ draw a horizontal line and through $Q$ a vertical line; let them meet at $R$. The coordinates of $R$ are $(x_2, y_1)$: it is in the same column as $Q$ and in the same row as $P$. Then $\triangle PRQ$ has a right angle at $R$.
The side $PR$ is horizontal, so $PR=|x_2-x_1|$. The side $RQ$ is vertical, so $RQ=|y_2-y_1|$. By Pythagoras in $\triangle PRQ$,
$$PQ^2=PR^2+RQ^2=|x_2-x_1|^2+|y_2-y_1|^2=(x_2-x_1)^2+(y_2-y_1)^2,$$because the square of a number and of its absolute value are equal. Taking the positive square root gives the formula. If $P$ and $Q$ are on one horizontal or vertical line, the triangle collapses to a segment, and the formula still gives the correct length (one of the two brackets is $0$). For the origin, put $(x_1, y_1)=(0, 0)$. $\blacksquare$
Because the brackets are squared, it makes no difference which point you call $P$ and which $Q$: $(x_2-x_1)^2=(x_1-x_2)^2$. For the same reason a negative difference causes no trouble โ $(-3)^2=9$.
1. Squaring the coordinates separately. $(x_2-x_1)^2$ is not $x_2^2-x_1^2$. For $(1, 2)$ and $(4, 6)$: $(4-1)^2=9$, but $4^2-1^2=15$.
2. Forgetting the square root. $(x_2-x_1)^2+(y_2-y_1)^2$ is the square of the distance. For $(1, 2)$ and $(4, 6)$ it is $25$, and the distance is $5$.
3. Mixing the coordinates. Subtract abscissa from abscissa and ordinate from ordinate. Subtracting $x_2-y_1$ is meaningless.
4. Splitting the square root. $\sqrt{9+16}=5$, not $\sqrt9+\sqrt{16}=7$. A root of a sum is not the sum of the roots.
Collinear points and the shape of a figure
Look at three points $A$, $B$, $C$ on a line, with $B$ between $A$ and $C$. Then walking from $A$ to $B$ and on to $C$ is the same as walking straight from $A$ to $C$: $AB+BC=AC$. If the points do not lie on a line, they form a triangle, and in a triangle two sides together are always longer than the third. So the distance formula settles collinearity.
Use exact values (square roots left as roots) when you add distances; a calculator value such as $7.62$ can hide a tiny difference that decides the answer, as the next example shows. The same distance idea identifies shapes:
| Figure | Distances to compute | Conclusion |
|---|---|---|
| Triangle | $AB, BC, CA$ | all equal: equilateral ยท exactly two equal: isosceles ยท all different: scalene |
| Triangle | squares of the sides | $AB^2+BC^2=CA^2$ (largest side) means a right angle at $B$ |
| Quadrilateral $ABCD$ | four sides | all four equal: rhombus (or square) ยท opposite sides equal: parallelogram |
| Quadrilateral $ABCD$ | sides and both diagonals $AC$, $BD$ | parallelogram + equal diagonals: rectangle ยท rhombus + equal diagonals: square |
Always compare squared distances: it avoids square roots and the arithmetic is exact. Take the square roots only for the final answer.
Exercises
- 1 $(6, 8)$ and the origin
- 2 $(-8, -15)$ and the origin
- 3 $(2, -3)$ and $(5, 1)$
- 4 $(-4, -1)$ and $(2, 5)$
- 5 $(0, 7)$ and $(24, 0)$
- 6 $(a, b)$ and $(-a, -b)$
- 7 $(1.5, 2)$ and $(4.5, 6)$
- 8 $(3, -6)$ and $(3, 9)$
- 1 Find $x$ if the distance between $(x, 3)$ and $(7, -1)$ is $5$.
- 2 Find $y$ if the distance between $(-3, y)$ and $(5, 2)$ is $10$.
- 3 Find the point on the $x$-axis that is equidistant from $(-1, 3)$ and $(5, 3)$.
- 4 Find the point on the $y$-axis that is equidistant from $A(6, 5)$ and $B(-2, 1)$.
- 5 Find the relation between $x$ and $y$ if $P(x, y)$ is equidistant from $(3, 6)$ and $(-3, 4)$.
- 6 Find the points on the $x$-axis whose distance from $(4, 12)$ is $13$.
- 7 If $P(x, y)$ is equidistant from $A(5, 1)$ and $B(-1, 5)$, show that $3x=2y$.
- 8 Which of $(6, -3)$, $(4, 5)$, $(-5, -5)$ and $(0, -6)$ is nearest to the origin?
- 1 Show that $(0, -3)$, $(2, 1)$ and $(4, 5)$ are collinear.
- 2 Show that $(1, 2)$, $(3, 5)$ and $(7, 10)$ are not collinear.
- 3 Show that $(-2, 0)$, $(2, 0)$ and $(0, 4)$ form an isosceles triangle that is not equilateral.
- 4 Show that $A(0, 0)$, $B(4, 3)$ and $C(-2, 11)$ form a right-angled triangle. Which angle is the right angle?
- 5 Show that $A(0, 0)$, $B(4, 3)$, $C(9, 3)$, $D(5, 0)$ form a rhombus but not a square.
- 6 Show that $A(0, 0)$, $B(3, 4)$, $C(-5, 10)$, $D(-8, 6)$ form a rectangle. Is it a square?
- 7 Find the point equidistant from $O(0, 0)$, $B(6, 0)$ and $C(0, 8)$, and the common distance.
- 1 Road map. On a map (1 unit = 10 km), town $A$ is at $(2, 3)$ and town $B$ is at $(8, 11)$. How far apart are the towns by air?
- 2 Throw to the keeper. Taking the batter as the origin (units in metres), a fielder stands at $(-12, 9)$ and the wicket-keeper at $(12, 16)$. How far must the fielder throw?
- 3 Bus route. A bus goes from the depot $P(0, 0)$ to stop $Q(6, 8)$, then to stop $R(6, 0)$ and back to the depot, all in a straight line each time (units in km). How long is the round trip?
- 4 Drone. A drone flies in a straight line from $(3, 4)$ to $(15, 9)$ over a field (units in metres, ignoring height). How far does it fly?
- 5 Football pitch. The corners of a field are $(0, 0)$, $(8, 0)$, $(8, 6)$ and $(0, 6)$ (units in metres). A ball lies at $(4, 3)$. How far is it from each corner?
- 6 Wi-Fi range. A router at $(2, -1)$ (units in metres) reaches phones up to $5$ m away. Which of the phones at $(5, 3)$, $(4, 0)$, $(3, -7)$ and $(6, 2)$ can connect?
How this is examined: the distance formula appears as a one-mark direct question, as a missing coordinate, as a collinearity or shape proof (three marks) and as a case study set on a map or a ground. Always state the formula first, show the substitution, and give the final answer with units.
E1. Board ยท 1 mark The distance of the point $(-7, 24)$ from the origin is (A) $25$ (B) $17$ (C) $31$ (D) $7$
E2. Board ยท 1 mark Assertion (A): The points $O(0, 0)$, $A(3, 4)$ and $B(6, 8)$ are collinear. Reason (R): $OA=5$, $AB=5$ and $OB=10$.
(A) Both A and R are true, and R is the correct explanation of A. (B) Both A and R are true, but R is not the correct explanation of A. (C) A is true but R is false. (D) A is false but R is true.
E3. Board ยท 2 marks Find the values of $x$ for which the distance between $A(-2, 3)$ and $B(x, -2)$ is $13$ units.
E4. Board ยท 3 marks Show that the points $P(2, -1)$, $Q(5, 2)$ and $R(2, 5)$ are the vertices of an isosceles right-angled triangle.
E5. Board ยท Case study Three friends take part in a relay on a school ground. Taking a corner as the origin and $1$ unit $=1$ m, Aman stands at $A(2, 2)$, Bhavna at $B(14, 7)$ and Chitra at $C(2, 7)$.
(i) Find the distances $AB$ and $BC$. (2 marks)
(ii) Show that the three friends stand at the corners of a right-angled triangle. (1 mark)
(iii) A fourth friend, Dev, stands at $D(14, 2)$. Show that $CD=AB$. (1 mark)
E6. JEE Main The point $P$ lies on the line $y=x$ and is equidistant from $A(0, 4)$ and $B(6, 2)$. Then $PA^2$ equals (A) $8$ (B) $10$ (C) $13$ (D) $18$
Research question. A delivery rider in a city of straight, parallel streets cannot go "as the crow flies": she must ride along the streets. How much longer is the street route than the straight-line distance, and does the extra distance depend on the direction of the trip?
Why it matters. Delivery companies, taxi apps and city planners all compare "straight-line distance" with "route distance". The straight-line distance (from the distance formula) is a quick estimate and a lower bound; the real route is always at least as long. Knowing how big the gap usually is helps in pricing a trip and in placing a warehouse.
What to do.
- On squared paper (1 square = 100 m), mark a start point and six destinations in different directions, at least two of them on a horizontal or vertical line from the start.
- For each destination, write the street distance (moving only along grid lines: $|\Delta x|+|\Delta y|$) and the straight-line distance (distance formula). Put them in a table with a third column "street รท straight".
- Which destinations have a ratio of exactly $1$? Which have the biggest ratio? Where on the grid are they?
- Check one straight-line distance on a real map app by measuring between two landmarks, and compare it with the app's walking distance.
- Write a rule in words for when the street route is much longer than the straight line.
Tools: Squared paper or a spreadsheet, a calculator, a map app on a phone
Hand in: Your table, the grid drawing, the map-app comparison, and a short paragraph answering the research question.
Going further. Try a destination exactly diagonal from the start ($\Delta x=\Delta y$) and compute the ratio. Does any destination give a ratio larger than that? (Look for the largest value you can find, and explain why you cannot beat it.)
๐งช Self-check quiz
Q1. The distance between $(2, 5)$ and $(-4, -3)$ is
Q2. The distance of the point $P(-5, 12)$ from the $y$-axis is
Q3. Three points satisfy $AB=7$, $BC=5$ and $AC=12$. Then
Q4. The triangle with vertices $(0, 0)$, $(6, 0)$ and $(3, 3)$ is
Q5. The point on the $x$-axis equidistant from $(2, 3)$ and $(6, 5)$ is