Formulas
- Distance: d = √((x₂ − x₁)² + (y₂ − y₁)²)
- Midpoint: ((x₁ + x₂) ÷ 2, (y₁ + y₂) ÷ 2)
- Slope: m = (y₂ − y₁) ÷ (x₂ − x₁)
- Line: y = mx + b, where b = y₁ − m·x₁
Example
For the points (1, 2) and (4, 6): distance 5, midpoint (2.5, 4), slope 1.3333 and line y = 1.3333x + 0.6667, or 4x − 3y + 2 = 0 in general form.
The distance formula is the Pythagorean theorem applied to the horizontal and vertical gaps between the points.
Frequently asked questions
What if x₁ = x₂?
The line is vertical. Its slope is undefined and its equation is x = x₁.
What does a negative slope mean?
The line goes down from left to right. A slope of 0 is a horizontal line.
How do I know if two lines are parallel or perpendicular?
Parallel lines have the same slope. Perpendicular lines have slopes whose product is −1, like 2 and −1/2.
See also
Results are estimates for information only and are not financial, legal or medical advice. Rates, taxes and fees vary — confirm with a professional or your lender.