Drag & drop or click to add images or PDF
The distance formula computes the straight-line distance between two points in coordinate space. It's a direct consequence of the Pythagorean theorem applied to the right triangle formed by the horizontal and vertical separation between the points.
2D form — for points and :
3D form — for points and :
-dimensional form (Euclidean distance):
This generalizes naturally to any number of dimensions, which is why it's the workhorse 'distance' notion in physics, statistics, and machine learning.
Draw a horizontal segment from to — length .
Draw a vertical segment from to — length .
The original segment is the hypotenuse of a right triangle with these two legs, so by the Pythagorean theorem:
Taking square roots gives the distance formula. The absolute values aren't needed because squaring removes the sign.
Note that the formula above is Euclidean distance. Manhattan distance measures travel on a grid (no diagonals). They are different metrics — make sure you know which one your problem wants.
The Pythagorean theorem. The horizontal and vertical separations between two points form the legs of a right triangle, and the straight-line distance is the hypotenuse. Squaring, summing, and taking a square root is exactly the Pythagorean recipe.
No. The formula is symmetric because the differences are squared. (x₂ - x₁)² and (x₁ - x₂)² are equal, so you can label the points either way.
Just add a squared difference for each dimension: d = √(Σ(b_i - a_i)²). This is the Euclidean distance in n-dimensional space, used heavily in machine learning, statistics, and physics.
That's a different problem — use the point-to-line distance formula: d = |Ax₀ + By₀ + C| / √(A² + B²) for line Ax + By + C = 0 and point (x₀, y₀). The basic distance formula only handles point-to-point.
Get step-by-step solutions to any math problem. Upload a photo or type your question.
Start Solving