Overview
The distance formula gives the straight-line distance between two points on a graph. It's the Pythagorean theorem in coordinates.
Enter x and y for both points.
Worked examples
| Inputs | Result |
|---|---|
| x10y10x23y24 | Distance: 5 |
Show 2 more examples
| x1-2y11x24y2-7 | Distance: 10 |
| x11.5y12x24y28 | Distance: 6.5 |
Distance by y2
With the calculator's starting values, the distance is 5. The table shows how it changes with the y2.
| y2 | Distance |
|---|---|
| 2 | 3.61 |
| 2.5 | 3.91 |
| 3 | 4.24 |
| 3.5 | 4.61 |
| 4starting value | 5 |
| 4.5 | 5.41 |
| 5 | 5.83 |
| 5.5 | 6.26 |
| 6 | 6.71 |
Other inputs: x1: 0 · y1: 0 · x2: 3. Change them in the calculator above for your own numbers.
How it works
The horizontal and vertical gaps form the two shorter sides of a right triangle, and the distance is its hypotenuse. Squaring removes negative signs, so the order of the points doesn't matter.
The formula
Practical tips
- (0, 0) to (3, 4) is 5, the classic 3-4-5 triangle.
- (−2, 1) to (4, −7) is √(36 + 64) = 10.
- For three dimensions, add (z₂ − z₁)² under the root.
Frequently asked questions
Does the order of points matter?
No, the distance is the same both ways.
Can distance be negative?
No, it's always zero or positive.
How is this related to the midpoint?
The midpoint is halfway along this same line.