Since we need only the lower CH to compute the upper envelope...
Start with a set of points
Sort points by x-coordinate
Add points one by one
- if the next point in order is above p0, ignore and move to the next (unless it is the last pt)
- For the first two “available” points draw the connecting line.
- For each point:
if (line (pi, pi-1) has points below it)
{discard point pi-1);
try forming lines with previous points
take the line that doesn’t have any points left below it; }
else
draw line (pi-1, pi);