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|.
Type two points or snap the graph. Straight-line distance, from the legs.
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.
Subtract the x-coordinates for the horizontal leg and the y-coordinates for the vertical one. The lengths are |x2 − x1| and |y2 − y1|.
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.
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.
(1, 2) → (4, 6)
d = √[(x2 − x1)2 + (y2 − y1)2]
Derived from the Pythagorean theorem in OpenStax College Algebra, section 2.1.
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.
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.
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.
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.
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.
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.
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.
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.