summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/asymptote/examples/mexicanhat.asy
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/asymptote/examples/mexicanhat.asy')
-rw-r--r--Master/texmf-dist/doc/asymptote/examples/mexicanhat.asy22
1 files changed, 22 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/asymptote/examples/mexicanhat.asy b/Master/texmf-dist/doc/asymptote/examples/mexicanhat.asy
new file mode 100644
index 00000000000..d55b127ae5c
--- /dev/null
+++ b/Master/texmf-dist/doc/asymptote/examples/mexicanhat.asy
@@ -0,0 +1,22 @@
+size(200);
+
+real mexican(real x) {return (1-8x^2)*exp(-(4x^2));}
+
+int n=30;
+real a=1.5;
+real width=2a/n;
+
+guide hat;
+path solved;
+
+for(int i=0; i < n; ++i) {
+ real t=-a+i*width;
+ pair z=(t,mexican(t));
+ hat=hat..z;
+ solved=solved..z;
+}
+
+draw(hat);
+dot(hat,red);
+draw(solved,dashed);
+