Skip to content
Medium

The Distance and Midpoint Formulas in 3D

Simple Explanation

Both the familiar 2D distance and midpoint formulas extend directly to three dimensions, simply by including a third term for the z-coordinates.

Why Do We Need It?

Measuring how far apart two points are, or finding the point exactly between them, is a basic building block used throughout the rest of this chapter and in later applications.

Formula

Distance and Midpoint in Three Dimensions

d = √[(xβ‚‚βˆ’x₁)Β² + (yβ‚‚βˆ’y₁)Β² + (zβ‚‚βˆ’z₁)Β²], M = ((x₁+xβ‚‚)/2, (y₁+yβ‚‚)/2, (z₁+zβ‚‚)/2)

Both the 2D distance and midpoint formulas extend directly to 3D, simply by including a third (z) term.

(x₁,y₁,z₁), (xβ‚‚,yβ‚‚,zβ‚‚)
β€” the coordinates of the two points
M
β€” the midpoint of the segment joining the two points

When to use it: Whenever the distance between two points in 3D space, or the point exactly halfway between them, is needed.

Worked Example

Find the distance between two points in 3D

Find the distance between A(1,2,3) and B(4,6,15).

    Why Does This Work?

    The 3D distance formula is really the Pythagorean theorem applied twice β€” first within the (x,y) plane to find the flat horizontal distance, and then again combining that horizontal distance with the vertical (z) difference into an overall straight-line 3D distance.

    Real-Life Example

    Finding the straight-line distance between two drones

    Two drones are flying at different heights and different horizontal positions.

    The 3D distance formula gives their actual straight-line separation directly, accounting for the height difference as well as the horizontal distance.

    Practice

    Find the midpoint's z-coordinate for A(2,0,4) and B(6,8,10).

    Medium

    Common mistake

    Forgetting the third (z) term entirely, and applying only the plain 2D distance or midpoint formula.

    Quick Review

    • d = √[(xβ‚‚βˆ’x₁)Β² + (yβ‚‚βˆ’y₁)Β² + (zβ‚‚βˆ’z₁)Β²].
    • Midpoint = ((x₁+xβ‚‚)/2, (y₁+yβ‚‚)/2, (z₁+zβ‚‚)/2).
    • Both formulas are the familiar 2D versions, extended with a third coordinate.