The idea in one breath
If two points lie on the same horizontal or vertical line, finding the distance between them is easy. You just subtract. For any other pair, there is a neat trick. The segment joining them is the hypotenuse of a right triangle whose legs are horizontal and vertical, and the Baudhāyana–Pythagoras theorem does the rest. In this lesson you will build the formula, see why the signs of the differences never matter, and then use it to test shapes and to find a midpoint.
Horizontal and vertical segments
If two points share a -coordinate, the segment between them is horizontal and its length is the difference of the -coordinates. From to , for example, the length is . It works the same way when the -coordinate is shared. From to the length is .
Take the larger minus the smaller, or find the difference and drop the sign. Either way, remember that a length is never negative.
A slanted segment
Let us try and . Walk from horizontally to the point directly below , then vertically up to . Triangle is right-angled at , with
and so, by the Baudhāyana–Pythagoras theorem,

The distance formula
For and , the horizontal leg is and the vertical leg is , so
Here is why you need not worry about signs. Squaring removes any minus sign, so it does not matter which point you call and which you call , or whether the coordinates are negative. If you reflect the whole picture in an axis, the signs change but the distances do not.
Example 1. Find the distance between and .
Example 2. Find the distance from the origin to .
This is worth remembering on its own: the distance of from the origin is always .
Example 3. Find the three sides of the triangle with vertices , and .
(horizontal). . .
Two sides come out equal, so the triangle is isosceles.

Testing a shape
Once you can find distances, you can answer quite a few questions about a shape without drawing it.
Isosceles or equilateral: compare the three sides and see how many match.
Right-angled: check whether the squares of two sides add up to the square of the third.
Collinear: three points lie on one line exactly when the two shorter distances add up to the longest one.
Example 4. Are , and collinear?
; ; . Since , the answer is yes.
Example 5. Show that , and form a right triangle.
Work with the squares of the sides: ; ; . Since , the angle at is a right angle. As a bonus, the two legs are equal, so it is a right isosceles triangle.
Example 6. Do , and all lie on one circle centred at the origin?
Distances from : , , . All three points are from , so yes, they lie on the circle of radius centred at .
The midpoint
Finding the point halfway along a segment is even easier. For the segment from to , the coordinates of the halfway point are just the averages.
Why does this work? Going from the first point to the second, changes by . At the halfway mark it has changed by half of that, giving . The same reasoning works for .
Example 7. Midpoint of and : .

Example 8. is the midpoint of and . Find .
gives ; gives . So .
Practice
- Find the distance between (a) and ; (b) and ; (c) and .
- Show that the triangle with vertices , and is isosceles.
- Are , and collinear?
- Show that , and are the vertices of a right triangle and find its hypotenuse.
- Which of , and lie on the circle of radius centred at the origin? Which is inside it?
- Find the midpoint of and .
- is the midpoint of and . Find .
- The vertices of a square are , , and in order. Verify that all four sides are equal and that the two diagonals are equal, and find the area.
Answers
Show answers
- (a) . (b) . (c) .
- Sides: , , . Two equal sides.
- , , . Yes.
- Sides , and ; . Hypotenuse , between and .
- Distances from : , , . The first and third are on the circle; is inside.
- .
- .
- Every side is . Diagonals: to is ; to is . Area square units.