Algebra formula reference

Distance Formula

Calculates the straight-line distance between two points in a coordinate plane.

Open in editor
LaTeXd=\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}

Variables

  • (x₁, y₁): first point
  • (x₂, y₂): second point
  • d: distance between the points

How to use this formula

Calculates the straight-line distance between two points in a coordinate plane.

Important notes

  • The formula follows from the Pythagorean theorem.
  • The order of the two points does not change the result.

Quick example

Points (1, 2) and (4, 6) are 5 units apart.

Applicability, worked calculation, and verification

Domain and applicability

Applies to two points in a Euclidean Cartesian plane; the result is always nonnegative and independent of point order.

Units

  • both coordinate axes must use compatible length units

Assumptions and domain checks

  • The order of the two points does not change the result.
  • For a real-valued result, each even-root radicand must be nonnegative unless complex values are intended.
  • For the Distance Formula, all variables must lie in the stated domain, and every denominator or inverse operation must be defined.

Do not use this formula when

  • Do not use Distance Formula when its variable definitions, domain restrictions, or structural assumptions differ from the problem.

Boundary and special cases

  • For Distance Formula, check zero, negative, and extreme input values before relying on the result.
  • When using Distance Formula, confirm that denominators, radicals, logarithms, and domain restrictions remain valid for the chosen values.

Equivalent and alternative forms

  • Keep the canonical LaTeX form d=\sqrt{(x_2-x_1)^2+(y_2-y_1)^2} for copying; rearrange only after preserving equivalence and domain restrictions.

Worked example

Input

(x1,y1)=(1,2), (x2,y2)=(4,6)

Output

d=5

The distance between (1, 2) and (4, 6) is √[(4 − 1)² + (6 − 2)²] = √(9 + 16) = 5.

  1. Find the horizontal change: Δx = 4 − 1 = 3.
  2. Find the vertical change: Δy = 6 − 2 = 4.
  3. Square and add the changes: 3² + 4² = 25.
  4. Take the nonnegative square root to obtain a distance of 5.

Independent verification

The coordinate differences form a 3–4–5 right triangle, so the computed straight-line distance of 5 is consistent with the Pythagorean theorem.

Common mistakes

  • Do not drop the radical boundary in Distance Formula; verify exactly which terms are inside the root and whether the chosen root is valid.
  • For the Distance Formula, check the final value in the original equation; algebraic rearrangement can introduce or lose solutions when domains are restricted.

Continue the workflow

Use Distance Formula in your own work

  1. Check the domainMatch the variables and assumptions to the problem before substituting values.
  2. Copy the exact notationPreserve grouping, signs, and exponents in d=\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}.
  3. Edit or convertOpen the expression in the LaTeX editor, then export it for your document or web page.

Review and verification

Last reviewed: 2026-07-26

Review method: Reviewed the notation, variable definitions, applicability conditions, worked workflow, and verification method for Distance Formula.

Verified against: OpenStax Algebra and Trigonometry

Automated quality check: Passed the core formula indexing gate.

Formula references

  • Algebra and Trigonometry 2eOpenStax, Rice University — Reviewed algebra, functions, sequences, trigonometry, and analytic geometry definitions and examples.

Frequently asked questions

What is the Distance Formula used for?

Calculates the straight-line distance between two points in a coordinate plane.

Can I copy this formula as LaTeX?

Yes. Copy d=\sqrt{(x_2-x_1)^2+(y_2-y_1)^2} or open it in the LaTeX editor.

What should I check before using it?

Confirm that each variable, unit, domain restriction, and assumption matches the problem.

Reuse, attribution, and correction

Share this reference without losing its source

Copy a citation, permanent link, Markdown link, or self-contained embed card. Each reusable format points readers back to the maintained canonical page.

Report an issue

Search the whole reference

Symbols, formulas, guides, tools and commands

Start typing to search.

move · Enter open · Esc close