2.3.2 · D5Coordinate Geometry

Question bank — Distance formula — derivation using Pythagoras

1,942 words9 min readBack to topic

Before we begin, three names we will reuse everywhere. First, distance means the length of the straight-line path between two points — how far you would travel flying directly from one to the other. We give this length the single letter ; it is always a length, so .

Now the shared picture: two points and always make a right triangle whose horizontal leg is the change in , whose vertical leg is the change in , and whose hypotenuse (the slanted side) is exactly that distance . Keep this triangle in mind — nearly every trap is really a question about that triangle.

Throughout this page we name the two leg lengths and : let be the horizontal leg and be the vertical leg. Both are lengths, so and always. With this naming the distance is , and every trap below secretly asks a question about these three quantities on the triangle in the figure.

Figure — Distance formula — derivation using Pythagoras

The second figure records one fact we lean on repeatedly — why the slanted path can never beat the grid-walking path. Refer back to it whenever a trap mentions the sum of the legs.

Figure — Distance formula — derivation using Pythagoras

True or false — justify

The straight-line distance always equals the horizontal change plus the vertical change
False. That sum is the grid-walking (Manhattan) distance. The straight line is the hypotenuse , which the leg-sum inequality (see the figure) shows is always shorter, equal only when one leg is .
Swapping the two points changes the distance
False. since squaring removes the minus sign, so . The formula is symmetric — the triangle is the same triangle no matter which corner you start from.
can be simplified to
False. The square root does not distribute over addition: . Numerically, , but . Only (products) splits, never sums.
If two points have the same -coordinate, the distance formula breaks down
False. It works perfectly: the horizontal leg , so . A vertical line is just a triangle with a zero leg — the formula quietly handles it.
The distance between two points can be zero
True, but only when the two points are identical: . For any two distinct points at least one coordinate differs, forcing .
Distance can come out negative if the coordinates are negative
False. Every term under the root is a square, hence , and we take the positive root. Negative coordinates are fine; they only affect the differences, which then get squared.
For points on the same horizontal line, distance equals
True. The vertical leg , leaving . Note the absolute value — it recovers a positive length from a possibly-negative difference.
The distance formula requires you to know which point is "first"
False. Because of symmetry, labelling is arbitrary. The only rule is to be consistent within one subtraction: and must use the same ordering.
always equals
False. It equals . If the difference is negative but the root is positive — that is exactly why the leg lengths carry absolute value bars, which squaring later makes redundant.

Spot the error

For and , a student writes for the -part. What went wrong?
They dropped the sign of . It should be . Subtracting a negative is adding.
A student computes . Where is the flaw?
The square root is not linear: . Concretely but , so you cannot take the root of each squared term separately; the root applies to the whole sum at once.
— spot the mistake.
The differences were never squared. Correct: . Forgetting the squares turns the Pythagorean distance into a meaningless quantity.
Someone writes inside the formula. Why is that wrong?
Squaring a negative gives a positive: . The minus is inside the square, so both copies of multiply to .
A student leaves the answer as after computing wrongly. What's the tell that something failed?
A distance under a root can never be negative — every squared term is , so their sum is . A negative number under the root is an immediate signal of a sign or squaring slip; here .
"The distance from to is , so the exact answer is ." Fix the wording.
is a rounded approximation; the exact distance is , an irrational number with no finite decimal. Reporting the decimal as "exact" throws away precision.

Why questions

Why do we use squares rather than just adding the two leg lengths?
Because the straight-line path is the hypotenuse of a right triangle, and Pythagoras — (hyp) = (leg)+(leg) — is the only relation that links the slanted side to the two perpendicular sides. Plain addition would measure the grid-walking path instead.
Why do the absolute values disappear when we move from legs to the final formula?
The legs are and , but the next step squares them. Since , the absolute-value bars become redundant — squaring already guarantees positivity.
Why do we keep only the positive square root at the end?
The equation has two algebraic roots, one positive and one negative, but distance is a length, and lengths are non-negative by definition. The negative root is discarded as physically meaningless.
Why does the formula still work when a point lies exactly on an axis, or at the origin?
The origin and axis points are ordinary coordinates like any other; their zeros simply make one difference . The triangle has a zero-length leg but the algebra never divides by anything, so nothing breaks.
Why is the same formula valid in every quadrant, including when both points are in the third quadrant with negative coordinates?
Because it works purely on differences that then get squared. The sign of any coordinate — or which quadrant a point sits in — is erased by the squaring, so no quadrant needs a special case.
Why is an acceptable, even preferred, final answer?
It is exact. Most distances are irrational, and leaving the surd keeps full precision; converting to a decimal introduces rounding error you may need later (e.g. squaring back in a circle equation).
Why can the straight-line distance never exceed the sum of the two legs?
Because — proved by squaring both non-negative sides, since and the extra . Geometrically this is the triangle inequality: one side of a triangle is at most the sum of the other two.
Why does extending to 3D just mean adding under the root?
Apply Pythagoras twice. First, in the horizontal plane, the two points' shadow separation is . Then make a new right triangle whose one leg is that shadow distance and whose other leg is the vertical rise ; its hypotenuse is the true space distance. Squaring gives . See Distance Formula in3D for the full box picture.

Edge cases

What does the formula give for two identical points and ?
. A point is distance from itself — the triangle collapses to nothing, and the formula correctly reports it.
What happens when the two points share a -coordinate but differ in ?
The vertical leg , so : a purely horizontal distance. The triangle flattens into a single line segment along the grid, with no vertical side at all.
If one coordinate difference is and the other is negative, does the formula still give a valid length?
Yes. Say the differences are and : . The zero contributes nothing, the negative is squared to positive — a clean, correct length.
When exactly does the straight-line distance equal the sum of the two legs, rather than being strictly less?
Only when one leg is zero, i.e. the points share an - or -coordinate. Then , the leg-sum inequality becomes equality, and the flattened triangle is the straight path — there is no shortcut left to take.
For collinear points on a slant line, does the distance formula agree with adding sub-distances?
Yes. If lies between and on a straight line, exactly. This "distances add along a straight line" fact underlies the Section Formula and Midpoint Formula.
What is the distance from a point to itself measured "the long way" — does the formula care about the path?
The formula measures only straight-line separation between endpoints; it has no notion of path. Any journey out and back returns distance between the coinciding start and end points.

Recall One-line summary of every trap

Distances live on a right triangle; squaring erases signs and quadrants, the root stays positive, sums don't split under the root, the hypotenuse never beats the leg-sum , and every degenerate case (same line, same point, on an axis) is just the general formula with a zero in it.

Connections