What this distance calculator does
This tool computes the straight-line distance between two points on the coordinate plane. Given the coordinates of two points, it applies the distance formula and returns the result in two forms: the exact form as a simplified radical (such as 5 or 2√13) and the decimal approximation. It draws a small graph showing the two points, the segment joining them, and the right triangle whose legs are the horizontal and vertical separations. Every step is shown: the differences, the squares, their sum, and the square root. The same run also reports the midpoint of the two points and the slope of the line through the two points, so you can jump straight to whichever coordinate-geometry quantity you actually needed.
The distance formula
Variable definitions
- \((x_1, y_1)\) — coordinates of the first point.
- \((x_2, y_2)\) — coordinates of the second point.
- \(\Delta x, \Delta y\) — horizontal and vertical differences (may be negative; they get squared).
- \(d\) — the straight-line distance between the two points.
10 worked examples (real homework wording)
Each example below uses the exact phrasing these questions appear with in search, and every answer has been verified. The same formula powers the slope calculator (which adds the line equation y = mx + c) and the linear equation solver (which solves ax + b = c).
Example 1: distance between (1, 2) and (4, 6)
- \(\Delta x = 4 - 1 = 3\), \(\Delta y = 6 - 2 = 4\).
- \(\Delta x^2 = 9\), \(\Delta y^2 = 16\).
- Sum \(= 9 + 16 = 25\).
- \(d = \sqrt{25} = \mathbf{5}\). This is a 3-4-5 right triangle.
Example 2: distance between (−3, 4) and (2, −8)
- \(\Delta x = 2 - (-3) = 5\), \(\Delta y = -8 - 4 = -12\).
- \(\Delta x^2 = 25\), \(\Delta y^2 = 144\).
- Sum \(= 25 + 144 = 169\).
- \(d = \sqrt{169} = \mathbf{13}\).
Example 3: distance between (0, 0) and (5, 12)
- \(\Delta x = 5\), \(\Delta y = 12\). Sum \(= 25 + 144 = 169\).
- \(d = \mathbf{13}\). Another Pythagorean triple.
Example 4: distance between (1, 1) and (5, 5) in simplest radical form
- \(\Delta x = 4\), \(\Delta y = 4\). Sum \(= 16 + 16 = 32\).
- \(\sqrt{32} = \sqrt{16 \times 2} = 4\sqrt{2}\).
- \(d = \mathbf{4\sqrt{2} \approx 5.6568542495}\)
Example 5: distance between (−2, −3) and (1, 1)
- \(\Delta x = 1 - (-2) = 3\), \(\Delta y = 1 - (-3) = 4\). Sum \(= 9 + 16 = 25\).
- \(d = \mathbf{5}\).
Example 6: distance between (2, 7) and (2, −1) — vertical segment
- \(\Delta x = 0\), so the segment is vertical.
- \(\Delta y = -1 - 7 = -8\). \(d = |\Delta y| = \mathbf{8}\).
Example 7: distance between (−4, 3) and (6, 3) — horizontal segment
- \(\Delta y = 0\), so the segment is horizontal.
- \(\Delta x = 6 - (-4) = 10\). \(d = |\Delta x| = \mathbf{10}\).
Example 8: distance between (0, 0) and (3, 4)
- \(\Delta x = 3\), \(\Delta y = 4\). Sum \(= 9 + 16 = 25\).
- \(d = \mathbf{5}\). The classic 3-4-5 triangle from the origin.
Example 9: distance between (1, 2) and (6, 9)
- \(\Delta x = 5\), \(\Delta y = 7\). Sum \(= 25 + 49 = 74\).
- 74 = 2 × 37 has no square factor, so the exact form is \(\mathbf{\sqrt{74} \approx 8.6023252670}\).
Example 10: distance between (−5, −5) and (0, 0)
- \(\Delta x = 5\), \(\Delta y = 5\). Sum \(= 25 + 25 = 50\).
- \(\sqrt{50} = \sqrt{25 \times 2} = \mathbf{5\sqrt{2} \approx 7.0710678119}\).
Why the distance formula is Pythagoras in disguise
Place two points \(P_1 = (x_1, y_1)\) and \(P_2 = (x_2, y_2)\) on the plane. Draw a horizontal line through \(P_1\) and a vertical line through \(P_2\); they meet at the corner \(C = (x_2, y_1)\). The three points form a right triangle whose right angle sits at \(C\).
The horizontal leg has length \(|\Delta x| = |x_2 - x_1|\) and the vertical leg has length \(|\Delta y| = |y_2 - y_1|\). The hypotenuse is the segment from \(P_1\) to \(P_2\), whose length is the distance \(d\) we want. Pythagoras gives:
Taking the positive square root gives the distance formula. Because the differences are squared, the sign of \(\Delta x\) and \(\Delta y\) does not matter — which is why subtracting in the opposite order gives the same answer.
Simplifying radicals (exact form)
Exams usually expect the answer as a simplified radical, not a rounded decimal. The method:
- Square the differences and add them — you now have a single number under the root.
- Find the largest perfect-square factor of that number. For 32, the largest perfect-square factor is 16 because 32 = 16 × 2.
- Split the root: \(\sqrt{32} = \sqrt{16} \times \sqrt{2} = 4\sqrt{2}\).
- If there is no perfect-square factor, the radical is already simplified — for example \(\sqrt{13}\), \(\sqrt{74}\).
- If the number is a perfect square (25, 169), the exact answer is an integer, so no radical is needed at all.
Writing \(\sqrt{32}\) as \(4\sqrt{2}\) is not cosmetic; it is the form the marking scheme awards marks for. A decimal like 5.66 is an approximation and is often worth fewer marks than the exact value.
Common mistakes to avoid
- Forgetting to square the differences. The formula is \(\sqrt{\Delta x^2 + \Delta y^2}\), not \(\sqrt{\Delta x + \Delta y}\). The square applies to the difference as a whole, not to the individual numbers.
- Sign errors when subtracting a negative. Subtracting \(-3\) is the same as adding 3. For example, \(2 - (-3) = 5\), not \(-1\). Write each subtraction out carefully.
- Taking the square root of the sum too early. Compute \(\Delta x^2\) and \(\Delta y^2\) first, add them, then take the square root of the total.
- Leaving the answer as an unsimplified radical. \(\sqrt{32}\) should be written \(4\sqrt{2}\). Leaving it unsimplified loses marks.
- Confusing distance with midpoint or slope. Distance is a length; the midpoint is a point halfway along the segment (use the midpoint calculator); the slope is the steepness of the line (use the slope calculator). They are different questions on the same segment.
Distance on a plane vs latitude/longitude distance
This calculator measures straight-line distance between two points on a flat coordinate plane, which is exactly what the coordinate-geometry syllabus requires. It is not the great-circle distance between two latitude/longitude coordinates on Earth. Lat/long distance is an arc on a sphere and uses the haversine formula; for two cities a few hundred kilometres apart, the flat-plane answer and the spherical answer will differ noticeably. If you need geographic distance, use a separate lat/long calculator rather than entering latitude and longitude into this one.
Where the distance formula appears in Class 9 & 10
- Coordinate geometry — proving that three points form an isosceles, right, or equilateral triangle.
- Circle geometry — a circle is the set of points at a fixed distance from the centre.
- Physics — displacement and magnitude of vectors.
- Trigonometry — deriving the sine and cosine rules uses the distance formula in disguise.
FAQ
What is the distance formula?
The distance between two points (x₁, y₁) and (x₂, y₂) is d = √((x₂ − x₁)² + (y₂ − y₁)²). It comes directly from the Pythagorean theorem.
Why is the distance formula related to Pythagoras?
Drawing the two points on a coordinate plane, the horizontal and vertical separations form the two legs of a right triangle. The distance between the points is the hypotenuse.
Can distance be negative?
No. Distance is the length of a line segment and is always non-negative. The formula squares the differences, making the result always zero or positive.
How do you write distance in simplest radical form?
Square the horizontal and vertical differences, add them, then take the square root. If the sum is not a perfect square, factor out the largest perfect-square divisor. For example, √32 = √(16 × 2) = 4√2. This calculator does that simplification automatically and shows the steps.
What is the distance between (1, 2) and (6, 9)?
Δx = 5 and Δy = 7, so d = √(25 + 49) = √74 ≈ 8.6023252670. 74 = 2 × 37 has no square factor, so the exact form is √74.
How do I find the distance with negative coordinates?
Subtract as usual and let the signs work out, then square. For (−3, 4) and (2, −8): Δx = 2 − (−3) = 5, Δy = −8 − 4 = −12, and d = √(25 + 144) = √169 = 13. Subtracting a negative is adding, so 2 − (−3) = 5, not −1.
What is the distance between a point and the origin?
Set (x₁, y₁) = (0, 0). The formula becomes d = √(x² + y²). For (3, 4) the distance is 5; for (5, 12) it is 13.
Is this the same as latitude/longitude distance?
No. This calculator gives straight-line distance on a flat coordinate plane. Latitude/longitude distance is a great-circle arc on a sphere and uses the haversine formula, so the two answers differ except over short distances.
Where is the distance formula used?
In coordinate geometry to prove triangles are isosceles, right, or equilateral; to define a circle as points a fixed distance from its centre; in physics for the magnitude of displacement and vectors; and in trigonometry when deriving the sine and cosine rules.
Related tools
Related Hira Academy resources
The distance formula is central to coordinate geometry in Class 9 and 10. Revise with our free Class 9 notes and Class 10 notes.