Allday Education

The Distance & Midpoint Formulas on the Coordinate Plane

Two points on a coordinate plane raise two natural questions: how far apart are they, and what point sits exactly halfway between them? The distance formula answers the first: d=(x2x1)2+(y2y1)2d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}. The midpoint formula answers the second: M=(x1+x22,y1+y22)M = \left(\dfrac{x_1 + x_2}{2}, \dfrac{y_1 + y_2}{2}\right).

Neither formula is new math. The distance formula is the Pythagorean theorem wearing coordinates, and the midpoint formula is nothing more than averaging. Once you see where each one comes from, there's very little left to memorize.

The distance formula is the Pythagorean theorem

Take the segment below from (1,2)(1, 2) to (4,6)(4, 6). Slide right from one endpoint and up to the other, and the dashed legs form a right triangle: a horizontal leg of 41=34 - 1 = 3 and a vertical leg of 62=46 - 2 = 4. The segment itself is the hypotenuse, so by the Pythagorean theorem its length is 32+42=25=5\sqrt{3^2 + 4^2} = \sqrt{25} = 5.

That's all the distance formula says: x2x1x_2 - x_1 is the horizontal leg, y2y1y_2 - y_1 is the vertical leg, and the square root puts the hypotenuse back together. It doesn't matter which point you call (x1,y1)(x_1, y_1) — the differences get squared, so any negative signs wash out.

-2-1123456-11234567xy

The midpoint formula is an average

The point halfway between two numbers is their average. The midpoint of a segment does that twice — once for the xx-coordinates and once for the yy-coordinates: M=(x1+x22,y1+y22)M = \left(\dfrac{x_1 + x_2}{2}, \dfrac{y_1 + y_2}{2}\right).

The most common midpoint mistake is subtracting instead of adding. Subtraction belongs to the distance formula; the midpoint adds the coordinates and halves them. If your midpoint doesn't land between the two endpoints, check that first.

In the figure below, MM sits exactly halfway along the segment — its coordinates are the averages of the two endpoints'.

-4-3-2-1123456-3-2-11234567xy
MM

Answers that aren't whole numbers

Distances often come out as square roots — that's normal. If the legs are 55 and 55, the distance is 50\sqrt{50}, which simplifies to 525\sqrt{2}. Leave it as a simplified radical unless the problem asks for a decimal.

Midpoints can have fraction coordinates for the same reason averages can: the midpoint of (0,0)(0, 0) and (5,8)(5, 8) is (52,4)\left(\dfrac{5}{2}, 4\right). A fraction there is a correct answer, not a mistake.

Worked examples

Example 1: a whole-number distance

Find the distance between (2,3)(2, 3) and (5,7)(5, 7).

Write the distance formulad=(x2x1)2+(y2y1)2d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}
Substitute the coordinatesd=(52)2+(73)2d = \sqrt{(5 - 2)^2 + (7 - 3)^2}
Simplify inside the radicald=9+16=25d = \sqrt{9 + 16} = \sqrt{25}
Take the square rootd=5d = 5

Answer: d=5d = 5

Example 2: a radical answer

Find the exact distance between (2,1)(2, 1) and (7,6)(7, 6).

Substitute into the distance formulad=(72)2+(61)2d = \sqrt{(7 - 2)^2 + (6 - 1)^2}
Simplify insided=25+25=50d = \sqrt{25 + 25} = \sqrt{50}
Simplify the radical: 50=25250 = 25 \cdot 2d=52d = 5\sqrt{2}

Answer: d=527.07d = 5\sqrt{2} \approx 7.07

Example 3: finding a midpoint

Find the midpoint of the segment with endpoints (2,5)(-2, 5) and (6,1)(6, 1).

Write the midpoint formulaM=(x1+x22,y1+y22)M = \left(\dfrac{x_1 + x_2}{2}, \dfrac{y_1 + y_2}{2}\right)
Substitute — add, don't subtractM=(2+62,5+12)M = \left(\dfrac{-2 + 6}{2}, \dfrac{5 + 1}{2}\right)
Simplify each coordinateM=(2,3)M = (2, 3)

Answer: M=(2,3)M = (2, 3)

Example 4: finding a missing endpoint

The midpoint of a segment is (3,2)(3, 2), and one endpoint is (1,6)(1, 6). Find the other endpoint.

Set up the xx-coordinate equation1+x2=3\dfrac{1 + x}{2} = 3
Multiply by 22, then subtract 111+x=6,x=51 + x = 6, \quad x = 5
Set up the yy-coordinate equation6+y2=2\dfrac{6 + y}{2} = 2
Multiply by 22, then subtract 666+y=4,y=26 + y = 4, \quad y = -2
Check: the midpoint of (1,6)(1, 6) and (5,2)(5, -2) is (62,42)=(3,2)\left(\dfrac{6}{2}, \dfrac{4}{2}\right) = (3, 2)

Answer: (5,2)(5, -2)

Try one yourself

-4-22468-4-2246xy

Common questions

Does it matter which point I call (x1,y1)(x_1, y_1)?

No. In the distance formula the differences get squared, so swapping the points flips the signs but not the answer. In the midpoint formula you're adding, and addition works in either order. Pick whichever assignment keeps the arithmetic comfortable.

How are the distance formula and the Pythagorean theorem related?

They're the same statement. The horizontal change x2x1x_2 - x_1 and the vertical change y2y1y_2 - y_1 are the legs of a right triangle, and the segment between the points is the hypotenuse. The distance formula is just a2+b2=c2a^2 + b^2 = c^2 solved for cc with coordinates plugged in.

How do I keep the two formulas from getting mixed up?

Match the operation to the job. Distance measures a gap, and gaps come from subtracting; the midpoint is an average, and averages come from adding and dividing by 22. If you catch yourself subtracting inside a midpoint, stop and re-set-up.

Want the video version?

Allday Everyday Math has video lessons, practice, and an AI tutor for every topic, Pre-Algebra through Algebra 2.

Try it for $1