summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/asymptote/examples/lemniscate.asy
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/asymptote/examples/lemniscate.asy')
-rw-r--r--Master/texmf-dist/doc/asymptote/examples/lemniscate.asy20
1 files changed, 20 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/asymptote/examples/lemniscate.asy b/Master/texmf-dist/doc/asymptote/examples/lemniscate.asy
new file mode 100644
index 00000000000..b151e43c18b
--- /dev/null
+++ b/Master/texmf-dist/doc/asymptote/examples/lemniscate.asy
@@ -0,0 +1,20 @@
+settings.outformat = "png";;
+settings.render = 16;
+size(8cm);
+
+import smoothcontour3;
+
+// Erdos lemniscate of order n:
+real erdos(pair z, int n) { return abs(z^n-1)^2 - 1; }
+
+real h = 0.12;
+
+real lemn3(real x, real y) { return erdos((x,y), 3); }
+
+real f(real x, real y, real z) {
+ return lemn3(x,y)^2 + (16*abs((x,y))^4 + 1) * (z^2 - h^2);
+}
+
+draw(implicitsurface(f,a=(-3,-3,-3),b=(3,3,3),overlapedges=true),
+ surfacepen=material(diffusepen=gray(0.5),emissivepen=gray(0.4),
+ specularpen=gray(0.1)));