Find the distance between two points and their midpoint.
The distance between two points on a plane comes straight from Pythagoras. The horizontal gap is x2 minus x1, the vertical gap is y2 minus y1, and the straight-line distance is the square root of the sum of their squares. The midpoint is simpler still: average the x values and average the y values, which gives the point exactly halfway along the segment.
Two practical notes. Squaring removes any sign, so the order of the points does not matter for distance — you get the same answer either way, which is a useful check. But it matters for direction if you are also calculating slope. And this straight-line formula assumes a flat plane, which is why it should not be used for distances between places on the Earth: over long spans the curvature makes a meaningful difference, and the haversine formula is used instead. For a room, a plot or a drawing, the flat-plane formula is exactly right.
Take the points (2, 3) and (10, 9). The horizontal gap is 10 − 2 = 8 and the vertical gap is 9 − 3 = 6. The distance is √(8² + 6²) = √(64 + 36) = √100 = 10. The midpoint is the average of each coordinate: ((2 + 10) ÷ 2, (3 + 9) ÷ 2) = (6, 6).
This is the same 3-4-5 triangle that builders use, just scaled by two (6-8-10). Spotting these whole-number patterns is a quick way to check your answer.
Last reviewed: 5 November 2026 by the YogiCalc team · How we calculate and verify · Spotted an error? Tell us
Not for distance. The differences are squared, which removes any negative sign, so you get the same result either way. Order does matter for slope and direction, where the sign carries meaning.
Average the coordinates: add the two x values and divide by two, then do the same for the y values. The result is the point exactly halfway along the line segment.
No. This formula assumes a flat plane, and over long distances the Earth’s curvature makes it inaccurate. Great-circle methods such as the haversine formula are used for geographic distance.
Add the third difference and square it alongside the others: the distance is the square root of the sum of the squared differences in x, y and z. The midpoint likewise averages all three coordinates.
Distance = √((x₂ − x₁)² + (y₂ − y₁)²). It comes directly from the Pythagorean theorem applied to the horizontal and vertical gaps between the points.
Yes. If the sum of the two x or y values is odd, the midpoint lands halfway between whole numbers, for example 1.5.