Two points on a grid, (3, 4) and (7, 1). How far apart are they? Most people reach for the grid and start counting squares — 4 across, 3 down — and then they stop, because counting squares diagonally does not work. The answer is exactly 5 units, and the reason it is exactly 5 is the whole story of coordinate geometry: distance, midpoint and slope are three views of the same right triangle.

The right triangle hiding between two points

Plot (3, 4) and (7, 1) and draw the segment between them. Now draw a horizontal line from (3, 4) to (7, 4), and a vertical line from (7, 4) down to (7, 1). Those three lines form a right triangle with the segment as its hypotenuse. The horizontal leg is the difference in x: 7 − 3 = 4. The vertical leg is the difference in y: 1 − 4 = −3, and length ignores the sign, so 3. Four and three — the legs of the most famous right triangle in mathematics.

That is why the distance formula is the Pythagorean theorem in disguise. Distance² = (difference in x)² + (difference in y)², so distance = √[(7 − 3)² + (1 − 4)²] = √(16 + 9) = √25 = 5. The 3-4-5 triangle appears because 4² + 3² = 25, and 25 is a perfect square. Whenever the two differences form a Pythagorean triple, the distance comes out a clean whole number — and teachers choose (3, 4) and (7, 1) precisely because the differences are 4 and 3.

The midpoint: just average each coordinate

The midpoint is the point exactly halfway along the segment, and the formula is almost embarrassingly simple: average the x-coordinates, average the y-coordinates. Midpoint = ((x₁ + x₂) / 2, (y₁ + y₂) / 2).

For our points: x = (3 + 7) / 2 = 5, y = (4 + 1) / 2 = 2.5. The midpoint is (5, 2.5). Check it against the geometry: it sits halfway across (x = 5 is 2 units from 3 and 2 units from 7) and halfway down (y = 2.5 is 1.5 units from 4 and 1.5 units from 1). It is also exactly 2.5 units from each endpoint — half the distance of 5 — which is the quickest sanity check in the topic. If your midpoint is not equidistant from both endpoints, you averaged wrong.

The most common midpoint mistake is averaging the wrong pair: students add x₁ to y₁, or average all four numbers into one. Keep the coordinates separate — x with x, y with y — and the formula never fails.

The slope: rise over run, with the sign doing the talking

Slope measures how steep the segment is: change in y divided by change in x. Slope = (y₂ − y₁) / (x₂ − x₁) = (1 − 4) / (7 − 3) = −3 / 4.

The negative sign matters. The segment falls as x grows, from y = 4 down to y = 1, so the slope is negative. A slope of −3/4 means that for every 4 units you move right, the line drops 3 units. Flip the order of the points and the slope is the same: (4 − 1) / (3 − 7) = 3 / −4 = −3/4. But mix up which difference goes on top and you get −4/3 instead — the reciprocal, a different line entirely. "Rise over run" is the memory hook: y-difference on top, x-difference underneath.

Two edge cases are worth knowing. A horizontal segment has a slope of 0 — the y-values are equal, so the numerator is 0. A vertical segment has an undefined slope — the x-values are equal, so the denominator is 0, and division by zero is not allowed. If your slope calculation ever divides by zero, the points share an x-coordinate and the segment is vertical.

Three more worked examples that build the pattern

From the origin to (6, 8). Distance = √(6² + 8²) = √(36 + 64) = √100 = 10. Midpoint = (3, 4). Slope = 8 / 6 = 4/3. This is the 6-8-10 triangle, the 3-4-5 triple doubled.

From (−2, 5) to (4, −3). The differences are 6 and −8, so distance = √(36 + 64) = 10 again. Midpoint = (1, 1). Slope = (−3 − 5) / (4 − (−2)) = −8 / 6 = −4/3. Negative coordinates change nothing about the method — they only make sign errors more likely, so write each subtraction out in full.

From (0, 0) to (5, 12). Distance = √(25 + 144) = √169 = 13. Midpoint = (2.5, 6). Slope = 12 / 5. The 5-12-13 triple is the second one worth memorizing, after 3-4-5.

Notice the pattern across all four: the distance formula never changes, the midpoint is always two averages, and the slope is always one division.

The three mistakes that cost the most marks

Forgetting to square before adding. The distance is √[(Δx)² + (Δy)²], not √(Δx + Δy). Adding 4 + 3 first and then taking the square root gives √7 — nonsense. Square each difference, then add, then take the root.

Dropping the negative sign in the slope. (1 − 4) is −3, not 3. A segment that falls left to right has a negative slope, and losing the sign flips the direction of the line.

Averaging all four coordinates into one number. The midpoint has two coordinates. Average the x-values for the x-coordinate and the y-values for the y-coordinate, separately.

Want the working shown instead of just the answer? A free distance and midpoint calculator finds the distance, midpoint and slope for any two points and shows every step — the differences, the squares, the square root. The guide to the distance between two points calculator walks through the (3, 4) to (7, 1) example in full. Check your own points on a free distance and midpoint calculator and the 3-4-5 pattern will start jumping out at you.