GenerateRandomSearch

Convex Hull Generator

The convex hull is the shape a rubber band would take if stretched around a set of points — the smallest convex boundary containing all of them. Most points end up strictly inside and contribute nothing to it, which is the interesting part: the hull is usually described by a small fraction of the set. Every point here is tested against every hull edge, so the enclosing claim is measured rather than assumed.

What this generator does

Scatters points, computes the hull with Andrew's monotone chain, and reports how many points are vertices, how many are strictly inside, and the boundary's area and perimeter.

How to use this tool

  1. Choose how many points to scatter.
  2. Work out which ones are on the boundary.
  3. Compare against the hull drawn, and the vertex count.
  4. Read the area and perimeter of the boundary.

Understanding the controls

How many points
Up to 120. More points rarely means many more hull vertices — the count grows roughly with the logarithm.
Seed
Reproduces exactly the same scatter and therefore the same hull.

Common use cases

  • Test cases for a convex hull implementation
  • Showing how few points actually define a boundary
  • Collision-bound and bounding-shape examples
  • Teaching orientation tests through cross products
  • Reproducing the same point set from a seed

How this generator works

Monotone chain sorts the points by x, then sweeps once for the lower boundary and once for the upper, popping any vertex that would make a clockwise turn. The check tests every point against every hull edge with a cross product: anything strictly outside fails it.

Randomness and fairness

The point positions are random; the hull is a deterministic consequence of them. Seeded sets reproduce and are therefore explicitly not cryptographically secure. Unseeded, the browser's cryptographically secure generator scatters the points.

For how randomness is produced across the whole site, see how Generate Random works.

Limitations and good to know

  • Two dimensions only — three-dimensional hulls are a substantially harder problem.
  • Collinear points on an edge may or may not be listed as vertices depending on the sweep.
  • The field is a fixed square with no units.
  • No animation of the sweep; the finished hull is drawn.
  • Point sets are not stored between visits.

Privacy and your data

Points and the hull are computed in your browser. Nothing is transmitted or retained.