Gradient

Courses

∇\nabla∇The maths behind AI0/72
π\piπMaths0/84
⋆\star⋆AI for everyone0/10
Γ\GammaΓGame theory0/49
py\texttt{py}pyPython for AI0/15
y^\hat{y}y^​Build your own AI0/15
All courses

Tuition

My tuition

Practice

ProjectsAsk a questionTrain on a GPUExplorationsMaths StoriesUnsolved problemsPlaygroundScience labs

Reference

GlossaryBlogDiscoveries
Tools › Maths

Distance, midpoint and slope calculator

Distance between two points, their midpoint and the slope of the line through them.

10

  1. Distance = √(6² + 8²) = √100 = 10
  2. Midpoint = ((1 + 7)/2, (2 + 10)/2) = (4, 6)
  3. Slope = 8 / 6 = 1.3333
  4. Line: y = 1.3333x + 0.6667

How it works

Distance = √((x₂ − x₁)² + (y₂ − y₁)²), which is Pythagoras on the grid. Midpoint = average of the x’s and of the y’s. Slope = rise over run.

Worked example

With x₁ = 1, y₁ = 2, x₂ = 7, y₂ = 10:

  1. Distance = √(6² + 8²) = √100 = 10
  2. Midpoint = ((1 + 7)/2, (2 + 10)/2) = (4, 6)
  3. Slope = 8 / 6 = 1.3333
  4. Line: y = 1.3333x + 0.6667

Answer: 10

Questions

Does the order of the points matter?
Not for the distance or midpoint. For the slope, swapping both points gives the same answer.

Learn the method properly

The chapter behind this tool, with animations, an experiment and an AI tutor who checks each step you write.

Open the chapter

More maths tools

  • Quadratic equation solver
  • LCM and HCF calculator
  • Fraction simplifier
  • Percentage calculator
  • Simple interest calculator
  • Compound interest calculator