Distance

Distance between two points — coordinates in any length unit.

Distance
5 ft
3 ft
Δx
4 ft
Δy

How to Use the Distance Calculator

  1. Enter the x-coordinate and y-coordinate of your first point (x₁, y₁) in the Point A fields.
  2. Enter the x-coordinate and y-coordinate of your second point (x₂, y₂) in the Point B fields.
  3. Click 'Calculate' (or let the calculator update automatically) to compute the result.
  4. Read the distance value displayed. The result is the straight-line length between the two points in the same units as your input coordinates.
  5. Optionally, review the step-by-step breakdown shown below the result to verify the calculation manually.

The Distance Formula

d = √[(x₂ − x₁)² + (y₂ − y₁)²]

The distance between two points is derived directly from the Pythagorean theorem. If you draw a right triangle connecting point A and point B, the horizontal leg has length |x₂ − x₁| and the vertical leg has length |y₂ − y₁|. The hypotenuse — the straight-line distance — is found by squaring both legs, summing them, and taking the square root.

This is known as the Euclidean distance formula and works for any two points in a 2D Cartesian coordinate system.

  • d — The straight-line (Euclidean) distance between the two points.
  • x₁, y₁ — The x-coordinate and y-coordinate of the first point (Point A).
  • x₂, y₂ — The x-coordinate and y-coordinate of the second point (Point B).
  • (x₂ − x₁) — The horizontal difference (run) between the two points.
  • (y₂ − y₁) — The vertical difference (rise) between the two points.

Worked Example: Distance Between Two Points

Point A = (1, 2) and Point B = (7, 10)
d = √[(7 − 1)² + (10 − 2)²]
d = √[(6)² + (8)²]
d = √[36 + 64]
d = √100
d = 10

Result: The distance between (1, 2) and (7, 10) is **10 units**.

What Your Result Means

The result 10 units means the shortest straight-line path from point (1, 2) to point (7, 10) is exactly 10 units long. Notice that this is a classic 6-8-10 Pythagorean triple (a scaled version of the 3-4-5 right triangle), which is why the answer comes out to a whole number. In most real-world problems the result will be an irrational number — the calculator returns the decimal approximation rounded to a reasonable number of significant figures.

Understanding Distance

Understanding the Distance Formula

The distance formula is one of the most fundamental tools in coordinate geometry. It is a direct application of the Pythagorean theorem (a² + b² = c²), where the two legs of the right triangle are the horizontal and vertical separations between your two points, and the hypotenuse is the distance you're solving for.

Historical Background

The relationship was established by the ancient Greek mathematician Euclid and later formalized in Cartesian coordinates by René Descartes in the 17th century. The coordinate plane itself is sometimes called the Cartesian plane in his honor.

When Is the Distance Formula Used?

  • Geometry: Finding side lengths of polygons, verifying shapes.
  • Physics: Calculating displacement between two positions.
  • Computer graphics & game development: Collision detection, pathfinding.
  • Mapping & navigation: Approximating straight-line distance between GPS coordinates at small scales.
  • Machine learning: Euclidean distance is a core measure in clustering algorithms (e.g., k-means).

Extending to 3D

The formula extends naturally to three dimensions:

d = √[(x₂−x₁)² + (y₂−y₁)² + (z₂−z₁)²]

Add a third squared difference under the radical for the z-axis.

Key Properties

  • Distance is always non-negative (d ≥ 0).
  • The distance from a point to itself is zero.
  • Distance is symmetric: d(A, B) = d(B, A) — the order of the points doesn't matter.
  • The straight-line distance is always the shortest path between two points in Euclidean space.

Common Mistakes

  • **Subtracting in the wrong order** — it doesn't matter whether you compute x₂−x₁ or x₁−x₂ because both are squared, making the sign irrelevant.
  • **Forgetting to take the square root** — the expression (x₂−x₁)²+(y₂−y₁)² gives the squared distance, not the distance itself.
  • **Adding before squaring** — you must square each difference separately before adding; (x₂−x₁+y₂−y₁)² is incorrect.
  • **Mixing up x and y coordinates** — always pair x with x and y with y when computing differences.
  • **Assuming the formula works on a globe** — the Euclidean distance formula is for flat (Cartesian) planes. For geographic distances over large areas, use the Haversine formula instead.
  • **Units confusion** — ensure both points are in the same unit system (e.g., both in meters or both in pixels) before interpreting the result.

Common Questions About Distance

What is the midpoint between two points?

The midpoint M between (x₁, y₁) and (x₂, y₂) is M = ((x₁+x₂)/2, (y₁+y₂)/2). It's the exact center of the line segment connecting the two points.

How do I find the distance between a point and a line?

The perpendicular distance from point (x₀, y₀) to the line ax + by + c = 0 is given by d = |ax₀ + by₀ + c| / √(a² + b²). This is different from the point-to-point distance formula.

How is the distance formula related to the Pythagorean theorem?

They are the same relationship expressed differently. If you plot two points, draw a horizontal line from one and a vertical line from the other to form a right triangle, the hypotenuse of that triangle is the distance between the points — which is exactly what a² + b² = c² calculates.

What is Manhattan distance and how does it differ from Euclidean distance?

Manhattan distance (also called taxicab distance) is |x₂−x₁| + |y₂−y₁| — the sum of the absolute differences, not the straight-line diagonal. It models travel on a grid (like city blocks) where diagonal movement is not allowed.

Frequently Asked Questions

Does it matter which point I label as Point A and which as Point B?

No. Because both differences are squared in the formula, the result is the same regardless of which point you enter first. d(A,B) always equals d(B,A).

Can I use negative coordinates?

Yes. The formula works perfectly with negative x or y values. Squaring the differences eliminates any negative signs, so (−3 − 5)² = (−8)² = 64, the same as (5 − (−3))² = 64.

What units does the calculator use?

The calculator returns a result in whatever units your input coordinates represent. If your coordinates are in meters, the distance is in meters. If they're in pixels, the distance is in pixels. The formula itself is unit-agnostic.

Is this the same as Euclidean distance?

Yes. The straight-line distance between two points in a 2D plane is the Euclidean distance. The term 'Euclidean' distinguishes it from other distance metrics like Manhattan distance or Chebyshev distance.

Can this calculator find the distance between two GPS coordinates?

Not directly. GPS coordinates are latitude/longitude values on a sphere, and using the flat-plane distance formula on them introduces error. For geographic distances, you would need the Haversine formula or a dedicated map distance tool.

Related Calculators

Sources

Only sources that have been reviewed are shown. Unverified citations are never published.

Spotted a calculation error?Report an Error