summaryrefslogtreecommitdiff
path: root/Master/texmf/doc/asymptote/examples/irregularcontour.asy
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf/doc/asymptote/examples/irregularcontour.asy')
-rw-r--r--Master/texmf/doc/asymptote/examples/irregularcontour.asy19
1 files changed, 19 insertions, 0 deletions
diff --git a/Master/texmf/doc/asymptote/examples/irregularcontour.asy b/Master/texmf/doc/asymptote/examples/irregularcontour.asy
new file mode 100644
index 00000000000..b72ddd0e08b
--- /dev/null
+++ b/Master/texmf/doc/asymptote/examples/irregularcontour.asy
@@ -0,0 +1,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);