diff options
author | Karl Berry <karl@freefriends.org> | 2014-04-21 23:02:35 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2014-04-21 23:02:35 +0000 |
commit | fab654a7fafba60c3d1e32040ad16d19b5dfd550 (patch) | |
tree | 699549d43c84af6b176173d794f17c7cc7164bc6 /Master/texmf-dist/doc/asymptote/examples/RiemannSphere.asy | |
parent | ea58320b10f549a61236be100fc97925aea6b489 (diff) |
asymptote 2.25 for TL14
git-svn-id: svn://tug.org/texlive/trunk@33606 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/asymptote/examples/RiemannSphere.asy')
-rw-r--r-- | Master/texmf-dist/doc/asymptote/examples/RiemannSphere.asy | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/asymptote/examples/RiemannSphere.asy b/Master/texmf-dist/doc/asymptote/examples/RiemannSphere.asy new file mode 100644 index 00000000000..ec1ab7586a9 --- /dev/null +++ b/Master/texmf-dist/doc/asymptote/examples/RiemannSphere.asy @@ -0,0 +1,47 @@ +import graph3; +import solids; + +currentlight=White; +defaultrender.merge=true; + +size(10cm,0); + +pair k=(1,0.2); +real r=abs(k); +real theta=angle(k); + +real x(real t) { return r^t*cos(t*theta); } +real y(real t) { return r^t*sin(t*theta); } +real z(real t) { return 0; } + +real u(real t) { return x(t)/(x(t)^2+y(t)^2+1); } +real v(real t) { return y(t)/(x(t)^2+y(t)^2+1); } +real w(real t) { return (x(t)^2+y(t)^2)/(x(t)^2+y(t)^2+1); } + +real nb=3; +for (int i=0; i<12; ++i) draw((0,0,0)--nb*(Cos(i*30),Sin(i*30),0),yellow); +for (int i=0; i<=nb; ++i) draw(circle((0,0,0),i),lightgreen+white); + + +path3 p=graph(x,y,z,-200,40,operator ..); +path3 q=graph(u,v,w,-200,40,operator ..); + +revolution sph=sphere((0,0,0.5),0.5); +draw(surface(sph),green+white+opacity(0.5)); + +draw(p,1bp+heavyred); +draw(q,1bp+heavyblue); + +triple + A=(0,0,1), + B=(u(40),v(40),w(40)), + C=(x(40),y(40),z(40)); + +path3 L=A--C; +draw(L,1bp+black); + +pen p=fontsize(8pt); + +dot("$(0,0,1)$",A,N,p); +dot("$(u,v,w)$",B,E,p); +dot("$(x,y,0)$",C,E,p); |