Distance formula
Two dots on a graph paper, and a question: how far apart are they, without touching a ruler? That is what the distance formula answers. Given two points and on the Cartesian plane, it turns their coordinates directly into the straight-line distance between them, using nothing more than subtraction, squaring, and one square root. The formula is the opening idea of the Class 10 chapter Coordinate Geometry, and it is not really new mathematics — it is the Pythagoras theorem you already know, rewritten so a right triangle can be built and measured purely from coordinates. Once you can find a distance, you can test whether points are equidistant, decide whether three points lie on one line, and classify triangles by their side lengths — all without drawing a single accurate diagram.
The distance between and is the hypotenuse of a right triangle built from their coordinate differences: .
The core idea
Plot and . Draw a horizontal line through and a vertical line through ; they cross at , and is a right triangle with the right angle sitting at .
- The horizontal leg has length — the run.
- The vertical leg has length — the rise.
- , the segment we actually want, is the hypotenuse.
By the Pythagoras theorem, , so the distance formula is
where: is the distance between the two points, and are their coordinates, and the two squared terms are the run and the rise of the right triangle joining them. Squaring each difference removes the need to worry about which coordinate is bigger — equals either way, so never depends on the order in which you list the two points; the formula is symmetric in and . A common special case is the distance of a point from the origin : putting gives , not a separate rule but the same formula with one point fixed. Two further properties are worth keeping in mind whenever the formula is applied. First, is always non-negative, and only when the two points coincide — a square root can never return a negative value, which matches the everyday sense that a distance of zero means "no gap at all." Second, the formula does not care whether and sit in the same quadrant, in different quadrants, or straddle an axis; the coordinate differences and automatically pick up the correct sign for the layout, and squaring erases that sign before it can cause trouble. This is why the same one-line formula works for every pair of points on the plane, with no separate cases to remember for "point in the second quadrant" or "points on the same vertical line." It also helps to see the formula as one entry in a small family of coordinate-geometry tools built on the same right-triangle idea. Once you can measure a single distance, you can measure three distances at once and compare them — that comparison is what lets you decide whether three points are collinear, or whether a triangle formed by three points is scalene, isosceles, equilateral, or right-angled, simply by looking at how the squared side lengths relate to one another.
Derivation of the distance formula
The goal is to show that the straight-line distance between any two points and on the Cartesian plane can be written purely in terms of their coordinates as , using only the Pythagoras theorem and nothing beyond it.
Step 1. Construct a right triangle from the two points. Through draw a line parallel to the x-axis, and through draw a line parallel to the y-axis. These two lines meet at the point , since shares its x-coordinate with and its y-coordinate with . The angle at is a right angle, because a horizontal line and a vertical line always meet at ninety degrees.
Step 2. Measure the two legs. The leg runs horizontally from to at the fixed height , so its length is . The leg runs vertically from to at the fixed position , so its length is . These are exactly the coordinate differences between the two original points.
Step 3. Apply the Pythagoras theorem to triangle , where is the hypotenuse opposite the right angle at . This gives . Since squaring a number and squaring its negative give the same result, the absolute value bars can be dropped without changing anything: .
Step 4. Take the positive square root, since a distance cannot be negative: . This holds for any placement of and — above, below, left, or right of each other — because the squaring step already absorbs every possible sign of the differences.
Step 5. Check the two edge cases to be sure the formula behaves sensibly. If , the two points lie on the same horizontal line and the formula collapses to , exactly the ordinary distance between two points on a number line. If , the points lie on the same vertical line and in the same way. Both special cases fall out of the general formula automatically, without needing separate rules, which is a good sign that the derivation is complete and consistent.
Worked example
Find the distance between and , and hence confirm the distance of from the origin.
Step 1. Label the coordinates: .
Step 2. Substitute into the formula: .
Step 3. Simplify the surd: . So units — and note is a Pythagorean triple, the same right-triangle idea used in the derivation, now with concrete numbers.
Competitive stretch
Step 4. Distance of from the origin, using the special case : . Since is not a perfect square, this stays as the surd units — a reminder that not every distance simplifies to a whole number.
Common traps
- Forgetting to square before adding. is wrong — each difference must be squared individually first, then added, then rooted.
- Sign errors from mismatched labelling. The order of subtraction ( vs ) doesn't matter since it gets squared, but mixing up which coordinate belongs to which point does — keep and clearly assigned.
- Leaving a surd unsimplified. should become , not stay as or get rounded off unless a decimal is asked for.
- Treating "distance from origin" as a separate rule. It is just , the general formula with one point fixed at — no new formula to memorise.
- Rushing the collinearity check without simplifying surds first. When comparing three pairwise distances to test collinearity, write every distance as a multiple of the same simplified surd wherever possible — spotting that is easy once all three are multiples of , but nearly impossible to see if they are left as , , and .
Ask the tutor: If a distance-formula problem gives an answer that doesn't match yours, ask the AI tutor to walk through the right-triangle picture and each step with your exact numbers.
Why do we square the differences instead of just subtracting the coordinates?
Because a plain subtraction like mixes horizontal and vertical movement in a way that has no geometric meaning, and it can even come out negative, which distance never should. Squaring each difference first turns both legs into positive lengths, and the Pythagoras theorem is precisely the rule for combining two perpendicular legs into a hypotenuse. That is the whole reason the formula has the shape it does — it is geometry, not an arbitrary algebra trick.
Does it matter which point I call P and which I call Q?
No. Swapping the two points swaps which difference is versus , but since , the squared terms come out identical either way, and so does the final distance. You can pick either point as the first one; just be consistent about which x goes with which y so you don't accidentally pair up the wrong coordinates.
How is the distance formula used to check if points form a triangle or are collinear?
Compute all three pairwise distances between the points. If the sum of two of them equals the third, the three points are collinear — one point sits exactly on the line joining the other two, and no triangle forms. If instead all three sums are strictly greater than the remaining side, the points form a genuine triangle, and comparing the squared distances further tells you whether it is right-angled (Pythagoras holds), isosceles (two distances equal), or equilateral (all three equal).