AlgoScope

Monotone Chain

AlgorithmadvancedGeometry Algorithmsalso called Andrew's algorithm

Sort by x, then build the lower and upper chains, popping while the turn is not a left turn.

Decision · step 4 of 26Plane Geometry: Monotone chain hull
A✓BCDEFGH×

lower hull: A, H, B is not a left turn (right turn), so H cannot be on the hull between them. Pop it.

Open in the player →or start at step 4

What you will see

Two chains grow and meet; each pops on a non-left turn.

How plane geometry works →

Cost

BestO(n log n)
AverageO(n log n)
WorstO(n log n)
SpaceO(n)

How you work with it here

play it through, step one change at a time, scrub to any step, run it on your own input, try operations in any order.

Screen readers: Points announce coordinates and role; each step announces the geometric test and its result in words (left turn, intersects).

Reduced motion: Shapes appear in place; the sweep line jumps between events.