06 nov. 2007

Unofficial package hull_pi.asy – fig0010

Figure 0001
(Compiled with Asymptote version 2.14svn-r5318)
    
import hull_pi;
import stats;
size(10cm);

pair[] cloud;
int nbpt=200;

// Generate random points.
for (int i=0; i < nbpt; ++i)
  cloud.push((10*unitrand(),10*unitrand()));

// Nodes of the hull (here convex hull);
/* View the definition of pair[] hull(pair[],real,real,real,real,int) */
pair[] hull=hull(cloud);

/* View the definition of path polygon(pair[]) */
filldraw(polygon(hull),lightgrey);
dot(cloud,red);