06 Nov 2007

Unofficial package hull_pi.asy – fig0030

Figure 0003
(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()));

////////// GREY PART: depthMax=1 //////////
pair[] hull=hull(cloud,depthMin=0,depthMax=1,angleMin=0,angleMax=360);
filldraw(polygon(hull),lightgrey);

////////// YELLOW PART: depthMax=2 //////////
pair[] hull=hull(cloud,depthMin=0,depthMax=2,angleMin=0,angleMax=360);
filldraw(polygon(hull),lightyellow);

////////// BLUE PART: depthMax=3 //////////
pair[] hull=hull(cloud,depthMin=0,depthMax=3,angleMin=0,angleMax=360);
filldraw(polygon(hull),lightblue);

dot(cloud,red);

Étiquettes :