"Fossies" - the Fresh Open Source Software Archive

Member "asymptote-2.60/examples/exp3.asy" (6 Nov 2019, 579 Bytes) of package /linux/misc/asymptote-2.60.src.tgz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 import graph3;
    2 import palette;
    3 
    4 size(12cm,IgnoreAspect);
    5 currentprojection=orthographic(1,-2,1);
    6 
    7 real f(pair z) {return abs(exp(z));}
    8 
    9 real Arg(triple v) {return degrees(exp((v.x,v.y)),warn=false);}
   10 
   11 surface s=surface(f,(-2,-pi),(2,pi),20,Spline);
   12 
   13 s.colors(palette(s.map(Arg),Wheel()));
   14 draw(s,render(compression=Low,merge=true));
   15 
   16 real xmin=point((-1,-1,-1)).x;
   17 real xmax=point((1,1,1)).x;
   18 draw((xmin,0,0)--(xmax,0,0),dashed);
   19 
   20 xaxis3("$\mathop{\rm Re} z$",Bounds,InTicks);
   21 yaxis3("$\mathop{\rm Im} z$",Bounds,InTicks(beginlabel=false));
   22 zaxis3("$|\exp(z)|$",Bounds,InTicks);