Distance Formula Calculator
Calculate the length of the segment joining two points on a plane or in space.
How to use the Distance Formula Calculator
- Choose the dimensions.
- Enter the x₁.
- Enter the y₁.
- Enter the z₁.
- Enter the x₂.
- Enter the y₂.
- Enter the z₂.
- Press Calculate. The result updates automatically as you type.
About the Distance Formula Calculator
The distance formula gives the straight-line ("as the crow flies") distance between two points whose coordinates you know. Draw a right triangle with the segment as its hypotenuse: the legs are the differences in x and y, so the Pythagorean theorem does the rest. In three dimensions, add the z difference the same way.
It is used for checking whether a triangle is isosceles from its vertices, finding the radius of a circle from its center and a point on it, measuring distances on a floor plan or CAD drawing, and in data science as Euclidean distance between data points. The sign of each difference does not matter because it is squared. For locations on Earth given in latitude and longitude, use a great-circle formula instead, since the surface is curved.
Formula
2D: d = √((x₂ − x₁)² + (y₂ − y₁)²)
3D: d = √((x₂ − x₁)² + (y₂ − y₁)² + (z₂ − z₁)²)
The formula is the Pythagorean theorem applied to the horizontal and vertical differences between the points.
Example calculation
Using the default values:
- Dimensions = 2D (x, y)
- x₁ = 1
- y₁ = 2
- x₂ = 4
- y₂ = 6
the calculator returns:
- Distance: 5
- Exact form: 5
Frequently asked questions
What is the distance between (1, 2) and (4, 6)?
Δx = 3 and Δy = 4, so d = √(9 + 16) = √25 = 5.
Does the order of the points matter?
No. Swapping the points changes the signs of the differences, but squaring removes the signs.
How is the distance formula related to the Pythagorean theorem?
The horizontal and vertical differences are the legs of a right triangle and the distance is its hypotenuse, so d² = Δx² + Δy².
Last updated: · Category: Math calculators