Distance
formula.

Type two points or snap the graph. Straight-line distance, from the legs.

See the distance.

The complete worked distance is in the app. Download Stephen AI to follow the legs and the square root.

Get Stephen AI Free

Two points.
One length.

A distance formula should show both legs before the square root, not a bare decimal. Stephen AI is the tutor on that walkthrough. That right triangle is one of the geometry formulas.

01

The two legs

Subtract the x-coordinates for the horizontal leg and the y-coordinates for the vertical one. The lengths are |x2 − x1| and |y2 − y1|.

02

Square, then the root

Square each leg, add them, and take the positive square root so the hypotenuse is d. The midpoint formula averages the coordinates instead, and it is a different calculation.

03

A 3-4-5 check

From (1, 2) to (4, 6) the legs are 3 and 4, so 32 + 42 = 25 and d = 5. That is how you use the formula for distance on the next pair. A root that will not simplify stays exact in the math solver.

Walking the distance between two points
Right triangle from (1, 2) to (4, 6): horizontal leg 3, vertical leg 4, hypotenuse d = 5. (1, 2) (4, 6) 3 4 d x y

(1, 2) → (4, 6)

d = √[(x2 − x1)2 + (y2 − y1)2]

  • 3 horizontal
  • 4 vertical
  • d = 5

Derived from the Pythagorean theorem in OpenStax College Algebra, section 2.1.

Questions,
clearly answered.

What is the distance formula?

The distance between the points (x₁, y₁) and (x₂, y₂) is d = √[(x₂ − x₁)² + (y₂ − y₁)²]. OpenStax College Algebra, section 2.1, defines it as the length of the segment joining those endpoints. The value is a length, so it is zero or positive.

How do you find the distance between two points?

Subtract the x-coordinates, subtract the y-coordinates, square both differences, add, and take the square root. From (1, 2) to (4, 6): 4 − 1 = 3 and 6 − 2 = 4, so d = √(3² + 4²) = √(9 + 16) = √25 = 5.

How is the distance formula related to the Pythagorean theorem?

The horizontal change and the vertical change are the legs of a right triangle. The segment between the points is the hypotenuse. OpenStax College Algebra, section 2.1, starts from a² + b² = c² with a = |x₂ − x₁| and b = |y₂ − y₁|, then drops the absolute values because a square is never negative.

Does the order of the points matter in the distance formula?

No. (x₂ − x₁)² equals (x₁ − x₂)², and the same is true for y. Labeling (4, 6) first and (1, 2) second still gives legs of 3 and 4, and d = 5. OpenStax notes that any number squared is positive, which is why the formula does not need absolute-value bars.

What is the correct order of operations for the distance formula?

Subtract inside each pair of parentheses first, square each difference, add those squares, then take the square root. OpenStax College Algebra, section 2.1, asks for that order. Squaring the coordinates before subtracting, as in x₂² − x₁², is a different quantity.

What is the distance formula in three dimensions?

Add the squared change in z. For (x₁, y₁, z₁) and (x₂, y₂, z₂), d = √[(x₂ − x₁)² + (y₂ − y₁)² + (z₂ − z₁)²]. OpenStax Calculus Volume 3, section 2.2, gives that as the distance between two points in space, extending the plane formula by one more leg.

How do you find the distance when two points share an x- or y-coordinate?

One leg is zero. If x₁ = x₂, then d = |y₂ − y₁|. If y₁ = y₂, then d = |x₂ − x₁|. The full formula still works: (1, 2) and (1, 5) give √(0² + 3²) = √9 = 3.

Can I use a distance formula solver for homework?

On practice work, compute the legs yourself and use a walkthrough to check the arithmetic. Follow your school’s academic integrity policy, and do not submit a solver’s write-up as your own. On a proctored exam, the formula is one you compute by hand.

Stephen AI Get it for Free