blob: b72ddd0e08b260ea17957b0d24fab25b38f89222 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
import contour;
size(200);
int n=100;
pair[] points=new pair[n];
real[] values=new real[n];
real f(real a, real b) {return a^2+b^2;}
real r() {return 1.1*(rand()/randMax*2-1);}
for(int i=0; i < n; ++i) {
points[i]=(r(),r());
values[i]=f(points[i].x,points[i].y);
}
draw(contour(points,values,new real[]{0.25,0.5,1},operator ..),blue);
|