Distance & Midpoint
Find the distance and midpoint between two points.
Between (1, 2) and (4, 6)
The average of the two x-values and the two y-values.
The distance between two points is √((x₂ − x₁)² + (y₂ − y₁)²) and the midpoint is the average of their coordinates. For (1, 2) and (4, 6): distance = √(3² + 4²) = √(9 + 16) = √25 = 5, and the midpoint is (2.5, 4).
What distance and midpoint measure
Given two points in the plane, the distance is the straight-line length of the segment joining them, and the midpoint is the point exactly halfway along that segment. The distance comes directly from the Pythagorean theorem: the horizontal gap (x₂ − x₁) and the vertical gap (y₂ − y₁) are the two legs of a right triangle, and the distance is its hypotenuse. The midpoint is simply the average of the x-coordinates paired with the average of the y-coordinates.
Midpoint M = ((x₁ + x₂)/2, (y₁ + y₂)/2)
Worked example
Distance and midpoint between (1, 2) and (4, 6):
- 1 Find the horizontal and vertical differences. x₂ − x₁ = 4 − 1 = 3 and y₂ − y₁ = 6 − 2 = 4.
- 2 Square each difference. 3² = 9 and 4² = 16.
- 3 Add the squares. 9 + 16 = 25.
- 4 Take the square root. √25 = 5, so the distance is 5.
- 5 Average the coordinates for the midpoint. ((1 + 4)/2, (2 + 6)/2) = (2.5, 4).
Distance and midpoint, side by side
Two points P₁ = (x₁, y₁) and P₂ = (x₂, y₂); the right column shows the (1, 2)–(4, 6) example.
| Quantity | Formula | Example |
|---|---|---|
| Horizontal gap | x₂ − x₁ | 4 − 1 = 3 |
| Vertical gap | y₂ − y₁ | 6 − 2 = 4 |
| Distance | √((x₂ − x₁)² + (y₂ − y₁)²) | √(9 + 16) = √25 = 5 |
| Midpoint | ((x₁ + x₂)/2, (y₁ + y₂)/2) | (2.5, 4) |
Why it works, and how far it extends
It is the Pythagorean theorem. The two coordinate differences form the legs of a right triangle, and the distance is the hypotenuse — so √((x₂ − x₁)² + (y₂ − y₁)²) is just a² + b² = c² rearranged.
The midpoint is an average. Halfway between two values is their mean, so you average the x-coordinates and the y-coordinates independently. This works for any two points, including negative coordinates.
It generalizes. The same idea extends to three dimensions by adding a (z₂ − z₁)² term under the root, and to the origin by setting one point to (0, 0).