CalculatorBoom

Distance Between (0, 0) and (5, 12)

See the full step-by-step calculation below, or try new coordinates.

Enter the coordinates of two points on a flat plane. The calculator finds the straight-line distance between them.

Distance

Calculation

The distance between (0, 0) and (5, 12) is √((5−0)² + (12−0)²) = √(25 + 144) ≈ 13 units.

Points plotted on a coordinate plane

How Is Distance Calculated?

The distance between two points is the length of the straight line connecting them, found using the Pythagorean theorem generalized to any number of dimensions. On a map or globe, distance instead usually means the great-circle distance — the shortest path along Earth's curved surface — which requires a different formula that accounts for the planet's roughly spherical shape.

The Distance Formulas

In 2D, the distance formula is a direct application of the Pythagorean theorem: the two points form the endpoints of the hypotenuse of a right triangle whose legs are the horizontal and vertical differences. The 3D version adds a third leg for the z-axis difference.

2D: d = √((x₂−x₁)² + (y₂−y₁)²)    3D: d = √((x₂−x₁)² + (y₂−y₁)² + (z₂−z₁)²)

Why Earth Distance Needs a Different Formula

The straight-line (2D/3D) distance formula assumes a flat plane, but Earth's surface is curved, so the shortest path between two far-apart coordinates is an arc, not a straight line. The haversine formula accounts for this by treating Earth as a sphere and computing the great-circle distance along its curved surface.

The Haversine Formula Has Small Known Error

Because Earth is actually an oblate spheroid (slightly flattened at the poles) rather than a perfect sphere, the haversine formula can have an error of up to about 0.5%. More precise methods, like Vincenty's formulae or Lambert's formula, model Earth's ellipsoidal shape and achieve accuracy on the order of meters over thousands of kilometers.

Distance Underlies Many Other Formulas

The 2D distance formula is the same relationship used to find the slope, midpoint, and length of a line segment, and it extends naturally to circle and sphere equations, since every point on a circle is defined as being a constant distance (the radius) from the center.

Example — Your Current Inputs

The distance between (0, 0) and (5, 12) is √((5−0)² + (12−0)²) = √(25 + 144) ≈ 13 units.

Additional Example — A 3-4-5 Triangle

The distance between (0, 0) and (3, 4) is √(3² + 4²) = √25 = 5 — a classic "3-4-5" right triangle that's often used to teach the Pythagorean theorem because every value comes out to a whole number.

Frequently Asked Questions

Does the order of the two points matter?

No — distance is always a positive value regardless of which point you label first, since the formula squares the differences before taking the square root.

Can I use this for real-world map distances?

Use the Lat/Long mode for that — it accounts for Earth's curvature using the haversine formula. The 2D and 3D modes assume a flat coordinate plane, which is only appropriate for geometry problems or short, local distances.

What units does the result use?

For 2D and 3D mode, the result is in whatever unit your coordinates are already in (unitless "units" by default). For Lat/Long mode, you choose between miles and kilometers directly.

Popular Results

See also