Slope, Distance & Midpoint Calculator
Distance, slope, midpoint and line equation from two points
Loading the tool…
Finds the distance, slope, midpoint and line equation from two points A(x₁, y₁) and B(x₂, y₂), with worked steps and a drawing on the coordinate plane.
How to use
- Enter the coordinates from "x of A (x₁)" to "y of B (y₂)". Whole numbers, fractions (1/2) and decimals work.
- The distance, slope, midpoint, line equation in three forms, the intercepts and the angle of inclination appear at once.
- "Steps" shows the formulas with your numbers, and the "Coordinate plane" shows the points, the line and the midpoint.
- For more, use "Dividing a segment", "Point P and line AB" or "Two points in space (3D)".
How it works
- Distance = √((x₂ − x₁)² + (y₂ − y₁)²), slope = (y₂ − y₁) ÷ (x₂ − x₁), midpoint = ((x₁ + x₂) ÷ 2, (y₁ + y₂) ÷ 2).
- If both x-coordinates are equal, the line is vertical, the slope is "Undefined" and the line is x = constant.
- Values are exact: a distance appears as a simplified root such as 2√5, a slope as a reduced fraction.
Questions and answers
- How do I find the distance between two points?
- Square the differences of the x- and y-coordinates, add them and take the square root. For (1, 2) and (4, 6): √(3² + 4²) = 5.
- How do I find the equation of a line through two points?
- Find the slope m, then use y − y₁ = m(x − x₁). For (1, 2) and (3, 6), m = 2 and the line is y = 2x.
- When is the slope undefined?
- When the two x-coordinates are equal. The change in x is 0, so you cannot divide by it; the line is vertical, such as x = 3.
- How do I find the point that divides a segment in a ratio?
- Dividing AB internally in the ratio m : n gives ((m x₂ + n x₁) ÷ (m + n), (m y₂ + n y₁) ÷ (m + n)). "Dividing a segment" also gives the external point.