Ad Space — Top Banner

Distance Formula

Calculate the distance between two points using d = √((x₂−x₁)² + (y₂−y₁)²).
Includes worked examples in 2D and 3D.

The Formula

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

The distance formula calculates the straight-line distance between two points in a coordinate plane. It is a direct application of the Pythagorean theorem — the distance is the hypotenuse of a right triangle formed by the horizontal and vertical differences.

This formula works for any two points, regardless of which quadrant they are in. The squaring ensures negative differences do not affect the result.

3D Distance

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

The formula extends naturally to three dimensions by adding the z-component. This is used in 3D graphics, physics simulations, and spatial analysis.

Variables

SymbolMeaningUnit
dDistance between the two pointsSame as coordinate units
(x₁, y₁)Coordinates of the first point
(x₂, y₂)Coordinates of the second point

Example 1

Find the distance between points A(2, 3) and B(8, 11).

Calculate differences: x₂ − x₁ = 8 − 2 = 6, y₂ − y₁ = 11 − 3 = 8

Square them: 6² = 36, 8² = 64

Sum and take the square root: d = √(36 + 64) = √100

d = 10 units

Example 2

A drone flies from position (1, 4, 2) to (5, 1, 6) in 3D space. What distance does it cover?

Calculate differences: Δx = 4, Δy = −3, Δz = 4

Square them: 16 + 9 + 16 = 41

d = √41

d ≈ 6.40 units

Example 3

Find the distance between (−3, 7) and (4, −1).

Differences: x₂ − x₁ = 4 − (−3) = 7, y₂ − y₁ = −1 − 7 = −8

d = √(7² + (−8)²) = √(49 + 64) = √113

d ≈ 10.63 units

When to Use It

  • Finding the straight-line distance between any two points on a plane or in space
  • GPS and mapping applications — calculating "as the crow flies" distances
  • Computer graphics — collision detection and object proximity
  • Robotics — path planning and obstacle avoidance
  • Verifying whether a point lies on a circle (compare distance to radius)

Ad Space — Bottom Banner

Embed This Calculator

Copy the code below and paste it into your website or blog.
The calculator will work directly on your page.