summaryrefslogtreecommitdiff
path: root/Build/source/utils/asymptote/examples/condor.asy
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/utils/asymptote/examples/condor.asy')
-rw-r--r--Build/source/utils/asymptote/examples/condor.asy32
1 files changed, 32 insertions, 0 deletions
diff --git a/Build/source/utils/asymptote/examples/condor.asy b/Build/source/utils/asymptote/examples/condor.asy
new file mode 100644
index 00000000000..d109335e3bf
--- /dev/null
+++ b/Build/source/utils/asymptote/examples/condor.asy
@@ -0,0 +1,32 @@
+// Peter Luschny's Condor function
+// http://www.luschny.de/math/asy/ElCondorYElGamma.html
+
+import palette;
+import graph3;
+
+size(300,300,IgnoreAspect);
+currentprojection=orthographic(0,-1,0,center=true);
+currentlight=adobe;
+real K=7;
+
+triple condor(pair t)
+{
+ real y=t.y;
+ real x=t.x*y;
+ real e=gamma(y+1);
+ real ymx=y-x;
+ real ypx=y+x;
+ real a=gamma((ymx+1)/2);
+ real b=gamma((ymx+2)/2);
+ real c=gamma((ypx+1)/2);
+ real d=gamma((ypx+2)/2);
+ real A=cos(pi*ymx);
+ real B=cos(pi*ypx);
+ return (x,y,log(e)+log(a)*((A-1)/2)+log(b)*((-A-1)/2)+log(c)*((B-1)/2)+
+ log(d)*((-B-1)/2));
+}
+
+surface s=surface(condor,(-1,0),(1,K),64);
+s.colors(palette(s.map(zpart),Rainbow()));
+
+draw(s,meshpen=black);