How it’s calculated
The distance between two points is the length of the straight line joining them. It comes from the Pythagorean theorem applied to the horizontal change Δx and the vertical change Δy. The midpoint is the point exactly halfway between them: the average of each pair of coordinates. The slope is the rise over the run.
Example: (1, 2) and (4, 6). Δx = 3 and Δy = 4, so the distance = √(9 + 16) = √25 = 5. The midpoint is ((1 + 4) ÷ 2, (2 + 6) ÷ 2) = (2.5, 4), and the slope is 4 ÷ 3 = 1.3333.
Frequently asked questions
Does the order of the points matter?
Not for the distance or the midpoint. Swapping the points flips the signs of Δx and Δy, but the slope stays the same.
Why is the slope “undefined”?
When both points have the same x value the line is vertical and the run is 0, so rise ÷ run would divide by zero. A vertical line has no slope value.
How do I find the distance in 3D?
Choose 3D and enter z for both points. The formula simply adds (z₂ − z₁)² under the square root.
What units is the distance in?
The same unit as your coordinates. If the coordinates are meters, the distance is in meters.
Embed this calculator
Add this free calculator to your own website. Copy the code below into your page’s HTML:
Need this calculator branded, changed or built around your own prices?See custom business solutions →
Sources
- College Algebra 2e, §2.1 The Rectangular Coordinate Systems and Graphs (distance and midpoint formulas) — OpenStax
- College Algebra 2e, §4.1 Linear Functions (slope) — OpenStax
- Calculus Volume 3, §2.2 Vectors in Three Dimensions (distance and midpoint in space) — OpenStax
Formulas are taken from the free public references above. Results are provided “as is” for informational and educational purposes only. See our disclaimer.
Added · Last updated · How we check our calculators
Spotted a mistake or missing option? Report a problem· Suggest a calculator