summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/asymptote/examples/trefoilknot.asy
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-04-07 18:26:53 +0000
committerKarl Berry <karl@freefriends.org>2013-04-07 18:26:53 +0000
commitb04c2e1a42573e9735547702356c7b9a769a6855 (patch)
treec0753443f39500a062d7698fe6b94359c813f871 /Master/texmf-dist/doc/asymptote/examples/trefoilknot.asy
parentfb0bf13304a356f197bfc1add17f98c07e96f17b (diff)
texmf -> texmf-dist: doc
git-svn-id: svn://tug.org/texlive/trunk@29714 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/asymptote/examples/trefoilknot.asy')
-rw-r--r--Master/texmf-dist/doc/asymptote/examples/trefoilknot.asy23
1 files changed, 23 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/asymptote/examples/trefoilknot.asy b/Master/texmf-dist/doc/asymptote/examples/trefoilknot.asy
new file mode 100644
index 00000000000..8ea5b264b48
--- /dev/null
+++ b/Master/texmf-dist/doc/asymptote/examples/trefoilknot.asy
@@ -0,0 +1,23 @@
+import tube;
+import graph3;
+import palette;
+currentlight=White;
+
+size(0,8cm);
+currentprojection=perspective(1,1,1,up=-Y);
+
+int e=1;
+real x(real t) {return cos(t)+2*cos(2t);}
+real y(real t) {return sin(t)-2*sin(2t);}
+real z(real t) {return 2*e*sin(3t);}
+
+path3 p=scale3(2)*graph(x,y,z,0,2pi,50,operator ..)&cycle;
+
+pen[] pens=Gradient(6,red,blue,purple);
+pens.push(yellow);
+for (int i=pens.length-2; i >= 0 ; --i)
+ pens.push(pens[i]);
+
+path sec=scale(0.25)*texpath("$\pi$")[0];
+coloredpath colorsec=coloredpath(sec, pens,colortype=coloredNodes);
+draw(tube(p,colorsec),render(merge=true));