Smart Unit ConvertersSmart Unit Converters

Distance & Midpoint Calculator

Find the distance between two points, the midpoint, slope, and angle. Interactive coordinate-plane visualization.

Point A

Point B

Coordinate plane

A(1, 2)B(7, 10)M(4, 6)
Distance
10.0000
Midpoint
(4.00, 6.00)
Slope
1.333
Angle from +x
53.13°
Δx
6.000
Δy
8.000

Step-by-step calculation

Formula

d = √((x₂ − x₁)² + (y₂ − y₁)²). Midpoint = ((x₁+x₂)/2, (y₁+y₂)/2). Slope = (y₂−y₁)/(x₂−x₁).

  1. 1A = (1, 2), B = (7, 10)
  2. 2Δx = x₂ − x₁ = 6, Δy = y₂ − y₁ = 8
  3. 3Distance = √((6)² + (8)²) = √100.0000 = 10.000000
  4. 4Midpoint = ((1 + 7)/2, (2 + 10)/2) = (4, 6)
  5. 5Slope m = 8 / 6 = 1.3333
  6. 6Angle from +x axis (counter-clockwise): 53.13°

?What is the Distance & Midpoint Calculator?

The Distance & Midpoint Calculator finds the straight-line (Euclidean) distance between two points in the 2D coordinate plane, plus their midpoint, the slope of the line connecting them, and the angle from the +x axis. Visualized on an auto-scaling coordinate plane with dashed right-triangle decomposition (Δx, Δy legs and the connecting hypotenuse) — making the Pythagorean origin of the distance formula obvious. Used in geometry homework, physics (vector magnitudes), surveying, computer graphics (collision detection, pathfinding), and game development.

The Formula

Distance: d = √((x₂−x₁)² + (y₂−y₁)²). Midpoint: M = ((x₁+x₂)/2, (y₁+y₂)/2). Slope: m = (y₂−y₁)/(x₂−x₁) (undefined if x₁=x₂).

The distance formula is the Pythagorean theorem applied to the right triangle whose legs are Δx = x₂−x₁ and Δy = y₂−y₁. The hypotenuse of that triangle IS the distance from A to B. The midpoint formula is just the average of the two coordinates — geometrically it's the centroid of the line segment. The slope is rise-over-run; it equals tan(θ) where θ is the angle from the +x axis.

Practical Examples

1

Distance from (0,0) to (3,4): √(9+16) = √25 = 5. The 3-4-5 Pythagorean triple.

2

Midpoint of (1,2) and (7,10): ((1+7)/2, (2+10)/2) = (4, 6).

3

Slope from (0,0) to (1,1) = 1 — a 45° line.

4

Distance between (0,0) and (1,1) = √2 ≈ 1.414. The diagonal of a unit square.

5

Map applications: 2 GPS points (treating lat/lng as Cartesian) — the formula gives a straight-line approximation that's accurate over short distances.

6

Computer graphics: distance is the basis of every collision check ('is enemy within attack range?').

Frequently Asked Questions

No — this calculator handles 2D only. For 3D add a z² term: d = √((x₂−x₁)² + (y₂−y₁)² + (z₂−z₁)²). The formula generalizes to any number of dimensions.

Popular Conversions

Jump to a ready-made conversion — useful for quick reference and sharing: