Distance: Pythagoras Lives on the Grid
In the previous guide you learned to pin every point to a pair of numbers on the Cartesian plane. Now we cash that in. Take two points, P_1 = (x_1, y_1) and P_2 = (x_2, y_2), and ask the most basic geometric question of all: how far apart are they? You could pace it off with a ruler, but the grid lets you compute it exactly. Drop straight across and straight up between the points, and a right triangle springs into being — its legs run along the gridlines, its hypotenuse is the very segment whose length you want.
The horizontal leg has length |x_2 - x_1| — just the gap between the two x-coordinates. The vertical leg has length |y_2 - y_1|. Now feed those two legs into the Pythagorean theorem, a^2 + b^2 = c^2, and the hypotenuse c is the distance you wanted. That is the entire derivation of the distance formula — it is not a new fact to memorise, it is Pythagoras applied to a triangle the grid drew for you.
Distance between P_1 = (x_1, y_1) and P_2 = (x_2, y_2):
|P_1 P_2| = sqrt( (x_2 - x_1)^2 + (y_2 - y_1)^2 )
Example: P_1 = (1, 2), P_2 = (4, 6)
horizontal gap = 4 - 1 = 3
vertical gap = 6 - 2 = 4
|P_1 P_2| = sqrt( 3^2 + 4^2 ) = sqrt( 9 + 16 ) = sqrt(25) = 5Midpoint: Just Average the Coordinates
Where is the exact middle of the segment from P_1 = (x_1, y_1) to P_2 = (x_2, y_2)? Geometrically the midpoint is the point that splits the segment into two equal halves — an idea you met long ago when bisecting a segment with compass and straightedge. On the grid it becomes almost embarrassingly easy. The middle x-coordinate is simply the average of the two x-values, and the middle y-coordinate is the average of the two y-values. That is the whole of the midpoint formula.
Midpoint of P_1 = (x_1, y_1) and P_2 = (x_2, y_2):
M = ( (x_1 + x_2)/2 , (y_1 + y_2)/2 )
Example: P_1 = (1, 2), P_2 = (4, 6)
M = ( (1 + 4)/2 , (2 + 6)/2 ) = ( 5/2 , 8/2 ) = ( 2.5 , 4 )Why does averaging work? Think of it one axis at a time. Along the x-axis the two points sit at x_1 and x_2; the spot dead-centre between any two numbers is their average, (x_1 + x_2)/2 — no different from finding the middle of two marks on a ruler. The same reasoning handles the y-axis independently. Because the horizontal and vertical positions are decoupled on the grid, you can average each coordinate on its own and reassemble them into the midpoint. This per-axis independence is the quiet superpower of coordinates, and it returns again and again.
Slope: Steepness Made into a Number
Distance and midpoint describe points and segments; slope describes a direction. It answers: as I walk along this line, how fast does it climb? The recipe is the famous rise over run — pick any two points on the line, divide the vertical change by the horizontal change, and the quotient is the slope, usually written m. A slope of 2 means the line climbs 2 units for every 1 unit you step to the right; a slope of 1/2 means a gentler climb of 1 up for every 2 across.
Slope of the line through (x_1, y_1) and (x_2, y_2):
m = (y_2 - y_1) / (x_2 - x_1) = rise / run
Example: (1, 2) and (4, 6)
m = (6 - 2) / (4 - 1) = 4 / 3
Horizontal line: y_2 = y_1, so rise = 0, m = 0.
Vertical line: x_2 = x_1, so run = 0, m is UNDEFINED.Two honest cautions live in that little box. First, a vertical line has run = 0, and division by zero is forbidden — so a vertical line has no slope at all. We do not say its slope is infinite; we say slope is undefined there, which is a precise statement, not a dodge. Second, the sign carries meaning: a positive slope rises left-to-right, a negative slope falls, and a slope of exactly 0 is dead flat. Do not confuse a slope of 0 (a horizontal line, perfectly well-defined) with an undefined slope (a vertical line) — they are opposite situations that beginners often swap.
One more reassurance: it does not matter which two points on the line you pick to measure the slope. Choose any pair and you get the same number, because the line keeps a constant direction — the larger right triangle and the smaller one are similar, so their rise-to-run ratios are identical. That constancy is exactly what makes slope a faithful single-number summary of a line's tilt, and it is why slope will be the engine of the line equations in the next guide.
Parallel and Perpendicular, Read Off the Slopes
Slope turns two purely geometric relationships into simple arithmetic, and this is where coordinate geometry starts to earn its keep. Two lines are parallel exactly when they point the same direction — and pointing the same direction means having the same slope. So to test whether AB || CD, you no longer need to extend the lines and check they never meet; you just compute both slopes and see if they match. Equal slopes, parallel lines. This is the parallel slopes criterion.
Perpendicular lines have a stranger but equally crisp signature: their slopes multiply to -1. Equivalently, one slope is the negative reciprocal of the other — flip the fraction and change its sign. If one line has slope 2, a line perpendicular to it has slope -1/2; if one has slope -3/4, the perpendicular has slope 4/3. The honest exception is the right-angle pair you cannot capture this way: a horizontal line (slope 0) and a vertical line (undefined slope) are perpendicular, yet 0 times undefined is not a sensible product. Handle that pair by sight, not by the formula.
Dividing in Any Ratio: The Section Formula
The midpoint splits a segment exactly in half, but sometimes you want a point that cuts it in some other ratio — one third of the way along, or in the ratio 2 to 3. The section formula delivers exactly that. If a point divides the segment from P_1 to P_2 in the ratio m to n (measured from P_1), then its coordinates are a weighted average of the endpoints, with the weights swapped onto the opposite ends.
Point dividing P_1=(x_1,y_1) to P_2=(x_2,y_2) in ratio m : n (from P_1):
P = ( (n*x_1 + m*x_2)/(m + n) , (n*y_1 + m*y_2)/(m + n) )
Check: ratio 1 : 1 (the midpoint)
P = ( (x_1 + x_2)/2 , (y_1 + y_2)/2 ) -- the midpoint formula falls out.The detail people get wrong is which weight goes where: to reach the point m-to-n of the way from P_1, the far endpoint P_2 is multiplied by m and the near endpoint P_1 by n — the weights are crossed. The honest sanity check is to plug in m = n = 1: the formula must reduce to the midpoint, and it does. If your version does not, you have the weights backwards. Whenever a fancier formula has a humbler one nested inside it as a special case, use that nesting to catch your own mistakes.
Putting the Three to Work Together
Apart, these are three handy formulas; together, they let you settle geometric questions by pure calculation. Want to know whether four points form a parallelogram? Check with the midpoint formula that the two diagonals share the same midpoint — if they bisect each other, it is a parallelogram, no protractor required. Want to know if a triangle is right-angled? Compute its three side lengths by distance and test whether a^2 + b^2 = c^2 holds. Each shape property has become a small algebra check.
- Decide what geometric claim you are testing — parallel sides, equal lengths, a right angle, a bisected diagonal.
- Translate it into the matching numerical test: equal slopes for parallel, slopes multiplying to -1 for perpendicular, equal distances for equal lengths, equal midpoints for a bisecting diagonal.
- Compute the needed slopes, distances, or midpoints from the coordinates — careful, consistent arithmetic, same point order throughout.
- Compare the numbers and state the conclusion. If they match the test, the geometric property holds; if not, it fails — and the numbers tell you honestly which.
This is the seed of the coordinate proof you will meet at the end of this rung: a way to prove honest geometric theorems with algebra instead of classical two-column reasoning. But keep one limit in view. These formulas, as written, assume the everyday flat plane with perpendicular axes and the ordinary notion of distance. On a sphere or in the curved geometries of much later rungs, distance is measured differently and these exact formulas no longer apply. Within the flat Cartesian world, though, they are exact, complete, and yours to use.