summaryrefslogtreecommitdiff
path: root/Master/texmf/doc/asymptote/examples/twistedtubes.asy
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-06-09 00:38:32 +0000
committerKarl Berry <karl@freefriends.org>2009-06-09 00:38:32 +0000
commit5a5ed51adcf876db905825989f564b51d622c0dd (patch)
treee735ac11e0f5fa09d2ef7c8992654fb5ff98b39e /Master/texmf/doc/asymptote/examples/twistedtubes.asy
parentfa0e85e77e9560d371aa26d0ddc1500c4c050e16 (diff)
asy doc, tlpsrc patterns
git-svn-id: svn://tug.org/texlive/trunk@13675 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf/doc/asymptote/examples/twistedtubes.asy')
-rw-r--r--Master/texmf/doc/asymptote/examples/twistedtubes.asy28
1 files changed, 28 insertions, 0 deletions
diff --git a/Master/texmf/doc/asymptote/examples/twistedtubes.asy b/Master/texmf/doc/asymptote/examples/twistedtubes.asy
new file mode 100644
index 00000000000..420e3898986
--- /dev/null
+++ b/Master/texmf/doc/asymptote/examples/twistedtubes.asy
@@ -0,0 +1,28 @@
+import graph3;
+import palette;
+
+size(300,300,keepAspect=true);
+
+real w=0.4;
+
+real f(triple t) {return sin(t.x);}
+triple f1(pair t) {return (cos(t.x)-2cos(w*t.y),sin(t.x)-2sin(w*t.y),t.y);}
+triple f2(pair t) {return (cos(t.x)+2cos(w*t.y),sin(t.x)+2sin(w*t.y),t.y);}
+triple f3(pair t) {return (cos(t.x)+2sin(w*t.y),sin(t.x)-2cos(w*t.y),t.y);}
+triple f4(pair t) {return (cos(t.x)-2sin(w*t.y),sin(t.x)+2cos(w*t.y),t.y);}
+
+surface s1=surface(f1,(0,0),(2pi,10),25,15);
+surface s2=surface(f2,(0,0),(2pi,10),25,15);
+surface s3=surface(f3,(0,0),(2pi,10),25,15);
+surface s4=surface(f4,(0,0),(2pi,10),25,15);
+
+pen[] Rainbow=Rainbow();
+s1.colors(palette(s1.map(f),Rainbow));
+s2.colors(palette(s2.map(f),Rainbow));
+s3.colors(palette(s3.map(f),Rainbow));
+s4.colors(palette(s4.map(f),Rainbow));
+
+draw(s1,meshpen=black);
+draw(s2,meshpen=black);
+draw(s3,meshpen=black);
+draw(s4,meshpen=black);