Skip to content

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

  1. Enter the coordinates from "x of A (x₁)" to "y of B (y₂)". Whole numbers, fractions (1/2) and decimals work.
  2. The distance, slope, midpoint, line equation in three forms, the intercepts and the angle of inclination appear at once.
  3. "Steps" shows the formulas with your numbers, and the "Coordinate plane" shows the points, the line and the midpoint.
  4. For more, use "Dividing a segment", "Point P and line AB" or "Two points in space (3D)".

How it works

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.