Definition · Diameter, and antipodal pairsThe diameter of a finite set is the largest distance between two of its points. Two points u, v of a convex polygon are an antipodal pair when there exist parallel supporting lines of the polygon, one through u and one through v — that is, lines touching the polygon with the whole polygon on one side of each.
Theorem · The diameter is attained by an antipodal pair of hull verticesLet S be a finite set with at least two points and let u, v attain its diameter. Then u and v are both vertices of the convex hull of S, and they are an antipodal pair of that hull.
Suppose u is not a hull vertex. Then u is a convex combination Σ λᵢ pᵢ of other points. The function x ↦ |x − v| is convex, so |u − v| ≤ Σ λᵢ |pᵢ − v|, and therefore some pᵢ is at least as far from v as u is. That pᵢ is a different point, so the pair (pᵢ, v) also attains the diameter, and repeating the argument reaches a hull vertex. The same runs for v.
For antipodality, let ℓᵤ be the line through u perpendicular to the segment uv, and ℓᵥ the line through v perpendicular to it. These are parallel. If some point w of S lay strictly on the far side of ℓᵤ from v, then |w − v| would exceed |u − v|, contradicting the diameter; so everything is weakly on one side of ℓᵤ, and likewise for ℓᵥ. Both are therefore supporting lines, and u, v are antipodal.
□
That proof is the whole justification for the algorithm and it is worth noticing what it does NOT say. It does not say every antipodal pair is a candidate worth examining because it is nearly the diameter; it says the diameter is among them, so examining all of them suffices. The calipers are an exhaustive search over a set that has been proved to contain the answer, which is why they can be confident rather than heuristic.
Example · Sixteen points, four on the hull, four pairsThe lab's cloud is the four corners of a 12-by-9 rectangle plus twelve points scattered inside it. The hull is the rectangle, h = 4, and the calipers examine 4 antipodal pairs. The squared diameter is 225, between (0, 0) and (12, 9) — and also between (12, 0) and (0, 9), since 12² + 9² = 225 either way. Testing all 16·15/2 = 120 pairs of input points returns the same value.
The two figures to hold on to are 4 and 120. The brute force is run on every redraw, on the same points, because an algorithm that visits the wrong pairs returns a distance that is real and simply not the largest — there is no internal inconsistency for it to trip over. As with the hull, the check is a different computation and not a second opinion from the same one.
Twelve interior points cost nothing, and that is the whole saving
Once the hull is built, the twelve interior points are never looked at again. That is where the reduction from 120 to 4 comes from, and it is worth being precise that the hull itself was not free: it cost a sort. The honest statement is that the diameter of n points costs a hull plus O(h), which is O(n log n) in total, against O(n²) for the scan. On sixteen points neither of those constants means much, and the page prints counts rather than claiming a speed.
The input where h is n
Take eight points in convex position — the lab has one such preset — and every point is a hull vertex. The hull has bought nothing, the calipers walk the whole input, and the antipodal-pair count is 8 against 28 pairs of points. The saving is smaller and still real. Now imagine n points on a circle: h = n, the hull costs a sort and discards nothing, and the calipers' linear walk is linear in n rather than in something smaller.
So h is a property of the input, not a bound on it. The lab says this directly in its status line, and it is the geometry version of the one thing this whole path keeps insisting on: the count you just watched is a measurement of the points on screen. 4 and 120 are true about this cloud. O(n log n) is the claim about every input, and it is proved by the hull bound and the linear walk rather than by either number.