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 — the geometry that the distance formula represents. Every step of the computation is shown: the differences, the squares, their sum, and the square root.
The distance formula
Variable definitions
- (x₁, y₁) — coordinates of the first point.
- (x₂, y₂) — coordinates of the second point.
- Δx, Δy — horizontal and vertical differences (may be negative; they get squared).
- d — the straight-line distance between the two points.
Worked examples
Example 1: (1, 2) and (4, 6)
- Δx = 4 − 1 = 3, Δy = 6 − 2 = 4.
- Δx² = 9, Δy² = 16.
- Sum = 9 + 16 = 25.
- d = √25 = 5. This is a 3-4-5 right triangle.
Example 2: (0, 0) and (2, 3)
- Δx = 2, Δy = 3.
- Δx² = 4, Δy² = 9. Sum = 13.
- 13 is prime, so √13 cannot be simplified further.
- d = √13 ≈ 3.6055512755
Example 3: (−1, 2) and (5, 10)
- Δx = 5 − (−1) = 6, Δy = 10 − 2 = 8.
- Δx² = 36, Δy² = 64. Sum = 100.
- d = √100 = 10. A 6-8-10 triple (multiple of 3-4-5).
Example 4: (1, 1) and (4, 5) — surd answer
- Δx = 3, Δy = 4. Sum = 9 + 16 = 25. Wait — this gives d = 5. Use different numbers.
- Try (1, 1) and (5, 5): Δx = 4, Δy = 4. Sum = 16 + 16 = 32.
- √32 = √(16 × 2) = 4√2.
- d = 4√2 ≈ 5.6568542495
Example 5: Horizontal and vertical segments
- (1, 3) and (7, 3): Δy = 0, Δx = 6. d = √36 = 6 — the distance is just the horizontal run.
- (4, 1) and (4, 9): Δx = 0, Δy = 8. d = √64 = 8 — the distance is just the vertical rise.
- When one difference is zero, the formula reduces to the absolute value of the other difference.
Where the distance formula appears in Class 9 & 10
The distance formula is fundamental to coordinate geometry and appears across the Punjab board syllabus:
- 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 sine and cosine rules uses the distance formula in disguise.
- Real-world problems — distance between two cities on a map, or between two locations on a grid.
Common mistakes to avoid
- Forgetting to square the differences. The formula is √(Δx² + Δy²), not √(Δx + Δy). Adding before squaring gives a wrong answer.
- Sign errors when subtracting a negative. Subtracting −3 is the same as adding 3. For example, 5 − (−2) = 7, not 3.
- Taking the square root of the sum too early. Compute Δx² and Δy² first, add them, and take the square root of the total. Do not take the square root of each square separately.
- Mixing up the points. The formula is symmetric, so it doesn't matter which point you call "1" and which "2" — as long as you're consistent within each subtraction.
- Leaving the answer as an unsimplified radical. √32 should be simplified to 4√2. √50 should be 5√2. Always simplify when possible.
- Confusing distance with displacement. In physics, distance is a scalar (always positive) while displacement is a vector that can be negative. The distance formula always gives a non-negative result.
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, applied to a right triangle whose legs are the horizontal and vertical separations between the points.
Why is the distance formula related to Pythagoras?
Drawing the two points on a coordinate plane, the horizontal separation and vertical separation form the two legs of a right triangle. The distance between the points is the hypotenuse. Pythagoras says hypotenuse² = leg₁² + leg₂², which is exactly the distance formula.
Can distance be negative?
No. Distance is the length of a line segment and is always non-negative. The difference x₂ − x₁ may be negative, but the formula squares it, which makes the contribution positive. The result is always zero or positive.
What is the distance between a point and itself?
Zero. When both points are the same, the differences are zero, the squares are zero, and the square root of zero is zero.
Does the order of the points matter?
No. The distance between A and B is the same as the distance between B and A. This is because the differences are squared, which removes any sign: (x₂ − x₁)² = (x₁ − x₂)².
How is distance used in physics?
Distance is fundamental in kinematics. On a position-time graph, distance between two positions gives displacement. The distance formula also appears in work calculations and in finding the magnitude of vectors.
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.