Rotating Calipers

Two parallel supporting lines rotate around a convex polygon — antipodal pairs reveal the diameter, width, and minimum-area rectangle

Hull: O(n log n) Calipers sweep: O(n) Total: O(n log n)
slow fast
Hull edge Caliper jaws Antipodal pair Current edge Best result

Step Info

Hull n: 0 Edge i: 0 Antipodal j: 0 Step: 0/0 j advances: 0
Press Play to start the rotating-calipers sweep. The base edge (orange) rotates; the antipodal vertex (purple) marches forward only.

Live Metrics

Diameter
Width
Min Rect Area
Elongation (D/W)

Complexity

OperationTime
Convex hull (preprocess)O(n log n)
Diameter sweepO(n)
Width sweepO(n)
Min-area rectangleO(n)
Brute force (all pairs)O(n²)
SpaceO(n)

Operation Log