Incremental three-dimensional convex hull algorithm (source code)

= Incremental three-dimensional convex hull algorithm

Start from a nondegenerate <tetrahedron> and insert remaining <points> one at a time. Discard a <point> inside the current <convex polyhedron>; otherwise replace faces visible from it by the cone from that <point> to the <horizon of a convex polyhedron>. Scanning every current face gives $O(n^2)$ worst-case <time complexity> and $O(n)$ current-hull storage in three dimensions. Coplanar input requires a separate degeneracy policy.