Distance, Midpoint and Slope Calculator
The distance, midpoint, slope and equation of the line between two points, with the working shown.
Distance
10
- Midpoint
- (4, 6)
- Slope (gradient)
- 1.3333
- Equation of the line
- y = 1.333333x + 0.666667
- Angle from the x-axis
- 53.1301 °
The points are 10 apart, with their midpoint at (4, 6). The line through them is y = 1.333333x + 0.666667.
How it's worked out
- Distance
√((7 − 1)² + (10 − 2)²)10 - Slope
(10 − 2) ÷ (7 − 1)1.333333 - Intercept
2 − 1.333333 × 10.666667
The formulas
d = √((x₂ − x₁)² + (y₂ − y₁)²) · midpoint = ((x₁ + x₂) ÷ 2, (y₁ + y₂) ÷ 2) · m = (y₂ − y₁) ÷ (x₂ − x₁)
Worked example
From (1, 2) to (7, 10): the distance is 10, the midpoint is (4, 6), the slope is 8 ÷ 6 = 1.3333, and the line is y = 1.333333x + 0.666667.
Questions people ask
How do I find the distance between two points?
Use Pythagoras: √((x₂ − x₁)² + (y₂ − y₁)²). From (1, 2) to (7, 10) is √(36 + 64) = 10.
How do I find the midpoint?
Average the x values and the y values: ((x₁ + x₂) ÷ 2, (y₁ + y₂) ÷ 2).
How do I find the slope?
Rise over run: (y₂ − y₁) ÷ (x₂ − x₁). A vertical line has no defined slope.
About this calculator
Formula and rules last checked 25 October 2026Written and tested by the CalculatorDex teamReport a problem
