IB Maths AI HLGeometry of 3D ShapesPaper 1 & 2Midpoint, distance in 3D~8 min read
3D Coordinate Geometry
The 2D midpoint and distance formulas extend naturally to 3D: just include a third coordinate. The distance formula is Pythagoras applied twice — first across the floor of a box, then up its vertical edge — giving √((x1−x2)2+(y1−y2)2+(z1−z2)2).
π What you need to know
Midpoint in 3D of (x1, y1, z1) and (x2, y2, z2): M = ((x1+x2)/2, (y1+y2)/2, (z1+z2)/2) — average each coordinate.
Distance in 3D: d = √((x1−x2)2+(y1−y2)2+(z1−z2)2) — 3D Pythagoras.
Both formulas are in the formula booklet (geometry & trigonometry section).
Why the distance formula works: the distance is the space diagonal of a rectangular box with side lengths |Ξx|, |Ξy|, |Ξz|. First find the floor diagonal √(Ξx2+Ξy2), then use Pythagoras again with the vertical edge Ξz.
Notation: line segment between A and B is [AB]; its length is AB or |AB|.
Why the 3D distance formula works
Imagine the line segment from A(x1, y1, z1) to B(x2, y2, z2) as the long diagonal of a rectangular box with edges parallel to the axes. The box has length |Ξx|, depth |Ξy|, height |Ξz|. First apply 2D Pythagoras to the box’s floor: the floor diagonal has length √(Ξx2+Ξy2). That floor diagonal and the vertical edge Ξz form a right-angled triangle (the vertical edge is perpendicular to the floor), so Pythagoras applies again, giving the full space diagonal √(floor2+Ξz2) = √(Ξx2+Ξy2+Ξz2). The 3D formula is just Pythagoras applied twice.
The space diagonal from O to C (bold teal) is built from the floor diagonal (red dashed, length 5) and the vertical edge (red dashed, length 12) using Pythagoras — giving √(52+122) = 13.
3D coordinate formulas
midpoint: ((x1+x2)/2, (y1+y2)/2, (z1+z2)/2)
distance: √((x1−x2)2+(y1−y2)2+(z1−z2)2)
Working with 3D coordinates
The procedure for 3D problems is identical to 2D — just include the z-coordinate every time. Label the coordinates (x1, y1, z1) and (x2, y2, z2) on the points before substituting. For reverse problems — finding a missing coordinate given a midpoint or a distance — set up an equation and solve. Quick mental check: if you get a 3D distance that’s smaller than any of the individual gaps |Ξx|, |Ξy|, |Ξz|, you’ve made an arithmetic error — the diagonal of a box can’t be shorter than any edge.
Spot 3D Pythagorean quadruples: the patterns (1,2,2,3), (2,3,6,7), (1,4,8,9), (4,4,7,9), (2,6,9,11), and (3,4,12,13) all give clean integer distances. They turn up surprisingly often in exam problems.
π§ Recipe — 3D coordinate geometry
Label the points: write (x1, y1, z1) and (x2, y2, z2) under the coordinates to avoid sign errors.
Pick the formula: midpoint (average) or distance (3D Pythagoras).
Substitute and simplify; watch the signs on differences involving negatives.
For reverse problems, write the formula with the unknown, then solve.
Sanity check: distance must be β₯ the largest single-coordinate gap.
Worked examples
WE 1
Basic distance and midpoint
Points P(1, 2, 1) and Q(3, 5, 7). (a) Find the distance PQ. (b) Find the midpoint of [PQ].
The midpoint of [AB] is M(2, −1, 4). Point A has coordinates (−1, 3, 2). Find the coordinates of B.
use B = 2M β A coordinate-wiseBx = 2(2) β (β1) = 5By = 2(β1) β 3 = β5Bz = 2(4) β 2 = 6B = (5, β5, 6)check: midpoint of (β1, 3, 2) and (5, β5, 6) = (2, β1, 4) β
WE 4
Median of a 3D triangle
A triangle in 3D space has vertices A(2, 0, −1), B(0, 4, 3), and C(−2, 2, 5). (a) Find the midpoint M of side [AC]. (b) Find the length of the median from B to M.
(a) midpoint of [AC]M = ((2+(β2))/2, (0+2)/2, (β1+5)/2)M = (0, 1, 2)(b) distance B to MBMΒ² = (0β0)Β² + (4β1)Β² + (3β2)Β²= 0 + 9 + 1 = 10BM = β10 β 3.16 unitsmedians of a triangle connect each vertex to the midpoint of the opposite side.
WE 5
Applied: drone flight path
A drone at position A(10, 20, 30) (coordinates in metres) flies in a straight line to position B(30, 50, 90). Find: (a) the total distance flown; (b) the drone’s position when exactly halfway through the flight.
A rectangular cuboid has one vertex at the origin O(0, 0, 0) and the opposite vertex at C(4, 3, 12). Find: (a) the length of the space diagonal OC; (b) the midpoint of OC (the centre of the cuboid); (c) show that the distance from this centre to each of the 8 vertices of the cuboid is the same.
(a) 3D distanceOCΒ² = 16 + 9 + 144 = 169OC = 13 units(b) midpoint of OCM = (2, 1.5, 6)centre = (2, 1.5, 6)(c) check distances from M to all 8 verticesto (0,0,0): β(4 + 2.25 + 36) = β42.25 = 6.5to (4,3,12): β(4 + 2.25 + 36) = 6.5to (4,0,0), (0,3,0), (0,0,12),…all give 6.5all 8 vertices at distance 6.5 = OC/2 βall 8 vertices lie on a sphere centred at M with radius OC/2 β this is the cuboid’s circumscribed sphere.
π‘ Top tips
Label coordinates before substituting: write (x1, y1, z1) and (x2, y2, z2) above the points.
Spot 3D Pythagorean quadruples: (1,2,2,3), (2,3,6,7), (1,4,8,9), (3,4,12,13) for clean integer answers.
Reverse midpoint shortcut: B = 2M − A in each coordinate.
For distances on coordinate planes: a point on the xy-plane has z = 0; on the x-axis has both y = z = 0. Use these constraints when locating unknown points.
Sphere centred at a point: the locus of points at fixed distance from a given centre is a sphere — comes up in cuboid and circumscribed-sphere problems.
β Common mistakes
Forgetting the z-coordinate in midpoint or distance — gives a 2D answer for a 3D problem.
Sign errors with negatives: 5 − (−3) = 8, not 5 − 3 = 2.
Forgetting the square root at the end of the distance formula — you computed d2, not d.
Using sum instead of average for midpoint — remember to divide by 2.
Adding coordinates instead of squaring differences in the distance formula.
Next up: Volume & Surface Area — the formulas for the basic 3D shapes (cuboids, cylinders, pyramids, cones, spheres), most of which are in the formula booklet.
Need help with 3D Coordinate Geometry?
Get 1-on-1 help from an IB examiner who knows exactly what Paper 1 & 2 are looking for.