summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/asymptote/examples/pseudosphere.asy
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/asymptote/examples/pseudosphere.asy')
-rw-r--r--Master/texmf-dist/doc/asymptote/examples/pseudosphere.asy33
1 files changed, 33 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/asymptote/examples/pseudosphere.asy b/Master/texmf-dist/doc/asymptote/examples/pseudosphere.asy
new file mode 100644
index 00000000000..a740381ef0e
--- /dev/null
+++ b/Master/texmf-dist/doc/asymptote/examples/pseudosphere.asy
@@ -0,0 +1,33 @@
+// Pseudosphere:
+// x = a sin(u) cos(v);
+// y = a sin(u) sin(v);
+// z = a (ln(tg(u/2))+cos(u));
+
+import three;
+import solids;
+import graph3;
+import palette;
+
+triple pseudosphere(real x) {
+ return (sin(x),0,cos(x)+log(tan(x/2)));
+}
+
+size(20cm,IgnoreAspect);
+currentprojection=orthographic(160,40,100);
+currentlight=(50,50,50);
+
+path3 G=graph(pseudosphere,0.5pi,0.965pi,10,Spline);
+
+revolution r=revolution(O,G,Z);
+
+draw(r,1,longitudinalpen=nullpen);
+surface s=surface(r);
+s.colors(palette(s.map(zpart),Gradient(cyan+white+opacity(0.9),
+ magenta+white+opacity(0.9))));
+draw(s);
+
+draw(r,6,backpen=linetype("10 10",10),longitudinalpen=nullpen);
+
+int n=10;
+for(int i=0; i < n; ++i)
+ draw(rotate(i*360/n,O,Z)*G);