Distance & Midpoint
Given two points on the coordinate plane, two of the most useful things you can calculate are the distance between them and the midpoint halfway along the segment connecting them.
Set Your Two Points
Use the sliders to place two points anywhere on the plane.
The Distance Formula
The distance between two points is just the Pythagorean theorem in disguise. The horizontal difference is one leg, the vertical difference is the other, and the distance is the hypotenuse.
Pythagorean connection: The distance formula is not a new idea — it is a² + b² = c² applied to the coordinate plane. The “legs” are the differences in x and y coordinates.
Visualizing the Segment
The line connecting P₁ to P₂ is plotted below. The line passes through both points with slope (y₂ - y₁) / (x₂ - x₁).
The yellow horizontal line marks the y-coordinate of the midpoint.
The Midpoint Formula
The midpoint is simply the average of the two endpoints — average the x-coordinates and average the y-coordinates:
Try this:
- Set both points to the same location — the distance is 0 and the midpoint is that same point.
- Place the points symmetrically about the origin — the midpoint lands at (0, 0).
- Move only x₂ while keeping everything else fixed — watch how the midpoint slides along.
Distance as a Function
Below, the x-axis represents x₂ (the x-coordinate of the second point), and the curve shows how the distance changes. Notice it forms a V-shape (absolute value behavior) — the distance is smallest when x₂ = x₁ and grows in both directions.
The minimum of this curve occurs at x = x₁, where the horizontal distance is zero. At that point, the total distance equals just |y₂ - y₁|.
Slope of the Segment
While we are here, the slope of the line through two points is:
Challenge: Find two points that are exactly 10 units apart with a midpoint at (1, 2). There are infinitely many answers — can you find at least two? (Hint: think of a circle of radius 5 centered at (1, 2).)