Distance Calculator

Calculate Euclidean and Manhattan distance between two points, plus midpoint and slope.

Point A

Point B

Euclidean Distance

5.000000

√(3² + 4²) = √(25)

Manhattan Distance7.000000
Midpoint(1.5, 2)
Slope1.333333
Δx (run)3
Δy (rise)4

How to Use the Distance Calculator

  1. Enter Point A as (x1, y1). The default is (0, 0).
  2. Enter Point B as (x2, y2). The default is (3, 4).
  3. Read the results: Euclidean distance (straight-line distance), Manhattan distance (grid-based distance), midpoint, and slope.

This is a 2D coordinate geometry calculator. For geographic distances between cities, you need a different tool that accounts for Earth's curvature.

Distance Formulas

Euclidean Distance (straight line):
  d = √[(x2 - x1)² + (y2 - y1)²]

  Example: A=(0,0), B=(3,4)
  d = √[(3-0)² + (4-0)²] = √[9 + 16] = √25 = 5

Manhattan Distance (grid path):
  d_M = |x2 - x1| + |y2 - y1|

  Example: A=(0,0), B=(3,4)
  d_M = |3| + |4| = 7
  (like navigating city blocks: 3 blocks right, 4 blocks up)

Midpoint:
  M = ((x1 + x2)/2, (y1 + y2)/2)

  Example: ((0+3)/2, (0+4)/2) = (1.5, 2)

Slope:
  m = (y2 - y1) / (x2 - x1) = 4/3 ≈ 1.333

Frequently Asked Questions

The distance formula calculates the straight-line distance between two points in a coordinate plane. It is derived from the Pythagorean theorem: d = √[(x2 - x1)² + (y2 - y1)²]. The horizontal and vertical differences form the legs of a right triangle, and the distance is the hypotenuse. For (0, 0) and (3, 4), the distance is √(9+16) = 5, a classic 3-4-5 right triangle.

Related Calculators