Reading the distance formula result
The table below shows how the distance formula relates to right-triangle legs formed by the two points.
| Quantity | Meaning |
|---|---|
| x₂ − x₁ | Horizontal leg of the right triangle (run) |
| y₂ − y₁ | Vertical leg of the right triangle (rise) |
| d | Hypotenuse — the straight-line distance between the points |
- When the two points share the same x-coordinate (a vertical line), the slope is undefined because the denominator (x₂ − x₁) is zero — the calculator reports "undefined" rather than a numeric slope in that case.
- The distance formula returns the same result regardless of which point is labeled 1 and which is labeled 2, since both differences are squared before summing.
What is the distance formula?
The distance formula calculates the straight-line distance between two points, (x₁, y₁) and (x₂, y₂), on a Cartesian coordinate plane. It is derived directly from the Pythagorean theorem: the horizontal and vertical differences between the points form the two legs of a right triangle, and the distance between the points is the hypotenuse.
Alongside distance, this calculator returns the midpoint (the point exactly halfway between the two given points) and the slope of the line through them, which describes the line's steepness and direction.
How to use this distance formula calculator
- Enter the coordinates of the first point, x₁ and y₁.
- Enter the coordinates of the second point, x₂ and y₂.
- Read the distance between the two points, their midpoint, and the slope and y-intercept of the line connecting them.
The distance formula
The distance formula is the Pythagorean theorem applied to the horizontal and vertical differences between two points.
Common mistakes
- Subtracting coordinates in the wrong order and forgetting the differences are squared anyway, so sign errors do not actually change the distance result.
- Forgetting to take the square root at the end — the formula under the root sign gives squared distance, not distance.
- Assuming slope is always defined — a vertical line (equal x-coordinates) has an undefined slope, not a slope of zero.
- Confusing the midpoint formula (average of coordinates) with the distance formula (Pythagorean sum of differences).
Frequently asked questions
What is the distance formula?
The distance formula is d = √((x₂−x₁)² + (y₂−y₁)²), derived from the Pythagorean theorem. For points (0,0) and (3,4), the distance is √(3² + 4²) = √25 = 5.
How do you find the midpoint between two points?
Average the x-coordinates and the y-coordinates separately: midpoint = ((x₁+x₂)/2, (y₁+y₂)/2). For (0,0) and (3,4), the midpoint is (1.5, 2).
How is the distance formula related to the Pythagorean theorem?
The horizontal difference (x₂−x₁) and vertical difference (y₂−y₁) between two points form the two legs of a right triangle; the straight-line distance between the points is the hypotenuse, so d = √(leg₁² + leg₂²) — exactly the Pythagorean theorem.
What does it mean if the slope is undefined?
A slope is undefined when the two points share the same x-coordinate, meaning the line connecting them is perfectly vertical. Division by zero (x₂ − x₁ = 0) has no defined value, so the slope cannot be expressed as a number.
Can the distance between two points be negative?
No. Distance is always zero or positive because it comes from a square root of a sum of squares, which is never negative. A distance of zero means the two points are identical.
How do you find the equation of the line through two points?
First calculate the slope, m = (y₂−y₁)/(x₂−x₁). Then find the y-intercept using b = y₁ − m×x₁. For points (0,0) and (3,4), m = 4/3 and b = 0 − (4/3)(0) = 0, giving the line y = (4/3)x.
References
- Weisstein, Eric W. "Distance" and "Midpoint." MathWorld — A Wolfram Web Resource.
- Standard coordinate-geometry textbook conventions (e.g. Larson, Precalculus, Cengage Learning).