Click the canvas to place coordinate points. Renders the enclosing convex hull polygon live using Andrew's monotone chain. Outputs C++ points vector.
The convex hull is the shape a rubber band would take around a set of pins. The Convex Hull Visualizer computes it with Andrew's monotone chain, an O(n log n) sort followed by two linear passes, and redraws it the instant you click another point onto the canvas.
Points are sorted by x and then by y, and the algorithm builds the lower boundary left to right, discarding any point that would make a clockwise turn, then repeats right to left for the upper boundary. The two chains meet at the extremes, which is why the endpoints are dropped before joining them.
A checkbox controls whether points lying exactly on a hull edge count as vertices. Both conventions appear on competitive judges depending on the problem statement, and comparing your own output against a tool that picked one silently is a reliable way to lose an hour. Everything runs in the page.
Points: 10, Hull: 8 and an area of 64500.0, computed by the shoelace formula over the hull vertices.vector<pair<int,int>> initialiser of every point, ready to paste into a local test.C++ Points Vector
vector<pair<int,int>> pts = {
{100, 80},
{200, 40},
{320, 90},
{380, 200},
{300, 300},
{180, 320},
{60, 240},
{50, 150},
{220, 180},
{160, 120}
};Hull Vertices
8
Hull Area
64500.00