Geometry

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.

x₁-3
-88
y₁-2
-88
x₂4
-88
y₂5
-88
P1=(3,  2)P2=(4,  5)P_1 = (-3,\; -2) \qquad P_2 = (4,\; 5)

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.

d=(x2x1)2+(y2y1)2=(43)2+(52)2d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2} = \sqrt{(4 - -3)^2 + (5 - -2)^2}
Connection

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₁).

-10-8-6-4-2246810-10-8-6-4-2246810Segment P₁P₂Midpoint y-level

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:

M=(x1+x20,  y1+y20)=(3+40,  2+50)M = \left(\frac{x_1 + x_2}0,\; \frac{y_1 + y_2}0\right) = \left(\frac{ -3 + 4 }0,\; \frac{ -2 + 5 }0\right)
Try This

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.

-10-8-6-4-22468102468101214

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:

m=y2y1x2x1=5243m = \frac{y_2 - y_1}{x_2 - x_1} = \frac{ 5 - -2 }{ 4 - -3 }
Challenge

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).)

Take the Quiz