Distance Formula Calculator
Find the distance between two points in 2D or 3D space, or sum a polyline path. Built on the Pythagorean theorem.
Distance Formula Examples
| Start | End | Dimensions | Distance |
|---|---|---|---|
| (0, 0) | (3, 4) | 2D | 5 |
| (-1, 2) | (2, 6) | 2D | 5 |
| (0, 0, 0) | (1, 2, 2) | 3D | 3 |
| (1, 1, 1) | (4, 5, 1) | 3D | 5 |
| (2, -3) | (2, 5) | 2D | 8 |
Frequently Asked Questions about the Distance Formula Calculator
What is the distance formula?
The distance formula derives from the Pythagorean theorem: d = sqrt((x2 - x1)^2 + (y2 - y1)^2). The horizontal and vertical differences form the two legs of a right triangle, and the distance between the points is the hypotenuse. For example, from (1, 2) to (4, 6) the legs are 3 and 4, giving d = sqrt(9 + 16) = 5.
How do you extend the formula to 3D?
Add a z-axis term: d = sqrt((x2 - x1)^2 + (y2 - y1)^2 + (z2 - z1)^2). This applies the same Pythagorean logic twice, first across the horizontal plane, then up into the third dimension.
What does polyline mode calculate?
Polyline mode sums the straight-line distances between every pair of consecutive points in the order you enter them, giving the total path length through all vertices. You can mix 2D and 3D points; any point without a z coordinate is treated as z = 0.
Does the order of the two points matter?
No. Both differences are squared before being summed, so swapping point A and point B produces the same distance.
Can the result be negative?
No. Squaring each difference eliminates negative signs, and the square root of a non-negative number is always non-negative. The result is zero only when both points are identical, and positive in every other case.
Related Calculators
More calculators in "Math"
Linear Regression CalculatorChi-Square CalculatorT-Test CalculatorArithmetic Sequence CalculatorGeometric Sequence CalculatorVector Calculator
See all 202 calculators in "Math"