diff options
author | Karl Berry <karl@freefriends.org> | 2021-01-02 16:31:31 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-01-02 16:31:31 +0000 |
commit | 6457cd3f6e21e23e21db6dafff021d17f5457567 (patch) | |
tree | 08f169333e47c5fc1c50e828cf3a0f50bdf9b508 /Build/source/utils/asymptote/examples/pOrbital.asy | |
parent | dc2504a4c02af0ec2fff00e6b833c6143a06b4cd (diff) |
asy 2.68 sources
git-svn-id: svn://tug.org/texlive/trunk@57291 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/utils/asymptote/examples/pOrbital.asy')
-rw-r--r-- | Build/source/utils/asymptote/examples/pOrbital.asy | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/Build/source/utils/asymptote/examples/pOrbital.asy b/Build/source/utils/asymptote/examples/pOrbital.asy new file mode 100644 index 00000000000..fc8e96e7fe0 --- /dev/null +++ b/Build/source/utils/asymptote/examples/pOrbital.asy @@ -0,0 +1,31 @@ +import graph3; +import palette; +size(200); +currentprojection=orthographic(6,8,2); +viewportmargin=(1cm,0); + +real c0=0.1; + +real f(real r) {return r*(1-r/6)*exp(-r/3);} + +triple f(pair t) { + real r=t.x; + real phi=t.y; + real f=f(r); + real s=max(min(f != 0 ? c0/f : 1,1),-1); + real R=r*sqrt(1-s^2); + return (R*cos(phi),R*sin(phi),r*s); +} + +bool cond(pair t) {return f(t.x) != 0;} + +real R=abs((20,20,20)); +surface s=surface(f,(0,0),(R,2pi),100,8,Spline,cond); + +s.colors(palette(s.map(abs),Gradient(palegreen,heavyblue))); + +render render=render(compression=Low,merge=true); +draw(s,render); +draw(zscale3(-1)*s); + +axes3("$x$","$y$","$z$",Arrow3); |