summaryrefslogtreecommitdiff
path: root/graphics/asymptote/examples/condor.asy
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /graphics/asymptote/examples/condor.asy
Initial commit
Diffstat (limited to 'graphics/asymptote/examples/condor.asy')
-rw-r--r--graphics/asymptote/examples/condor.asy32
1 files changed, 32 insertions, 0 deletions
diff --git a/graphics/asymptote/examples/condor.asy b/graphics/asymptote/examples/condor.asy
new file mode 100644
index 0000000000..5ce5caa241
--- /dev/null
+++ b/graphics/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=White;
+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),16,Spline);
+s.colors(palette(s.map(zpart),Rainbow()));
+
+draw(s,render(compression=Low,merge=true));