Unofficial package hull_pi.asy – fig0010

Category: Asymptote,hull_pi.asy,Unofficial packagesPh. Ivaldi @ 18 h 09 min

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);


Unofficial package hull_pi.asy – fig0020

Category: Asymptote,hull_pi.asy,Unofficial packagesPh. Ivaldi @ 19 h 09 min

Figure 0002
(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: angleMin=90 //////////
pair[] hull=hull(cloud,depthMin=0,depthMax=infinity,angleMin=90,angleMax=360);
filldraw(polygon(hull),lightgrey);

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

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

dot(cloud,red);


Unofficial package hull_pi.asy – fig0030

Category: Asymptote,hull_pi.asy,Unofficial packagesPh. Ivaldi @ 20 h 09 min

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 :


Unofficial package hull_pi.asy – fig0040

Category: Asymptote,hull_pi.asy,Unofficial packagesPh. Ivaldi @ 21 h 09 min

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

pair[] cloud;
int nbpt=15;
int depthMax=3;

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

////////// WHITE PART: pivot automaticly computed //////////
pair[] hull=hull(cloud,depthMin=0,depthMax=depthMax,angleMin=0,angleMax=360);
draw(polygon(hull),2mm+white);

// ////////// RED PART: pivot=1 //////////
pair[] hull=hull(cloud,depthMin=0,depthMax=depthMax,angleMin=0,angleMax=360,1);
draw(polygon(hull),1mm+red);

// ////////// BLUE PART: pivot=3 //////////
pair[] hull=hull(cloud,depthMin=0,depthMax=depthMax,angleMin=0,angleMax=360,3);
draw(polygon(hull),bp+blue);

dot(cloud,yellow);
shipout(bbox(3mm,Fill));

Étiquettes :