|
|
|
Figure 0001: fig0010.asy (Compiled with Asymptote version 1.43) |
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);
|
|
|
Figure 0002: fig0020.asy (Compiled with Asymptote version 1.43) |
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);
|
|
|
Figure 0003: fig0030.asy (Compiled with Asymptote version 1.43) |
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);
|
|
|
Figure 0004: fig0040.asy (Compiled with Asymptote version 1.43) |
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));
Dernière modification/Last modified: Fri Aug 15 01:40:20 CEST 2008
Philippe Ivaldi