Distance Between Two Points Calculator

Calculate the distance between two points using the distance formula. Also find the midpoint, slope, and equation of the line through the points.

Enter Two Points

Point 1 (x1, y1)

Point 2 (x2, y2)

Result

Distance
10
units
Distance10
Midpoint(5, 7)
Slope (m)1.333333
Line Equationy = 1.33x + 0.33
Angle with x-axis53.13 deg
Distance Squared100

Step-by-Step Solution

d = sqrt((8-2)^2 + (11-3)^2) = sqrt(36 + 64) = sqrt(100) = 10

The Distance Formula

The distance formula calculates the straight-line distance between two points in a 2D coordinate plane. Given two points (x1, y1) and (x2, y2), the distance d is:

d = sqrt((x2 - x1)2 + (y2 - y1)2)

This formula is a direct application of the Pythagorean theorem. By treating the horizontal difference as one leg and the vertical difference as the other leg of a right triangle, the distance between the two points is the hypotenuse.

Related Calculations

Distance Formula

The straight-line distance between two points derived from the Pythagorean theorem.

d = sqrt((x2-x1)^2 + (y2-y1)^2)

Midpoint Formula

The point exactly halfway between two given points.

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

Slope Formula

The steepness and direction of the line passing through two points.

m = (y2-y1) / (x2-x1)

Line Equation (Point-Slope)

The equation of the line through two points using point-slope form.

y - y1 = m(x - x1)

Slope-Intercept Form

The standard form of a line equation showing slope and y-intercept.

y = mx + b, where b = y1 - m*x1

3D Distance Formula

Extension of the 2D formula to three-dimensional space.

d = sqrt(dx^2 + dy^2 + dz^2)

Derivation from the Pythagorean Theorem

Consider two points P1(x1, y1) and P2(x2, y2). Draw horizontal and vertical lines from each point to form a right triangle. The horizontal leg has length |x2 - x1| and the vertical leg has length |y2 - y1|. By the Pythagorean theorem (a2 + b2 = c2), the hypotenuse c equals sqrt((x2-x1)2 + (y2-y1)2), which is exactly the distance formula.

Understanding the Midpoint

The midpoint of a line segment is the point that divides the segment into two equal halves. It is found by averaging the x-coordinates and y-coordinates separately: M = ((x1+x2)/2, (y1+y2)/2). The midpoint is equidistant from both endpoints.

Understanding Slope

The slope of a line measures its steepness. A positive slope means the line rises from left to right, while a negative slope means it falls. A slope of zero indicates a horizontal line, and an undefined slope (when x1 = x2) indicates a vertical line. The slope is calculated as m = (y2 - y1) / (x2 - x1), often described as "rise over run."

Practical Applications

  • Navigation: Finding the straight-line distance between two locations on a map.
  • Physics: Calculating displacement, determining distances between objects.
  • Computer graphics: Collision detection, determining proximity of objects.
  • Engineering: Surveying, structural analysis, circuit board design.
  • Data science: Similarity measures, clustering algorithms, nearest-neighbor search.

Common Examples

  • (0, 0) to (3, 4): d = sqrt(9 + 16) = sqrt(25) = 5 (a classic 3-4-5 right triangle).
  • (1, 1) to (4, 5): d = sqrt(9 + 16) = 5, midpoint (2.5, 3), slope = 4/3.
  • (-2, 3) to (4, -1): d = sqrt(36 + 16) = sqrt(52) = 7.211, slope = -2/3.