Advertisement
Hirwanto

asympt03

Jan 26th, 2015
2,051
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. \begin{asy}
  2. import graph3;
  3.  
  4. size(469pt);
  5.  
  6. viewportmargin=0;
  7.  
  8. currentprojection=perspective(
  9. camera=(25.0851928432063,-30.3337528952473,19.3728775115443),
  10. up=Z,
  11. target=(-0.590622314050054,0.692357205025578,-0.627122488455679),
  12. zoom=1,
  13. autoadjust=false);
  14.  
  15. triple f(pair t) {
  16.   real u=t.x;
  17.   real v=t.y;
  18.   real r=2-cos(u);
  19.   real x=3*cos(u)*(1+sin(u))+r*cos(v)*(u < pi ? cos(u) : -1);
  20.   real y=8*sin(u)+(u < pi ? r*sin(u)*cos(v) : 0);
  21.   real z=r*sin(v);
  22.   return (x,y,z);
  23. }
  24.  
  25. surface s=surface(f,(0,0),(2pi,2pi),8,8,Spline);
  26. draw(s,lightolive+white,"bottle",render(merge=true));
  27.  
  28. string lo="$\displaystyle u\in[0,\pi]: \cases{x=3\cos u(1+\sin u)+(2-\cos u)\cos u\cos v,\cr
  29. y=8\sin u+(2-\cos u)\sin u\cos v,\cr
  30. z=(2-\cos u)\sin v.\cr}$";
  31.  
  32. string hi="$\displaystyle u\in[\pi,2\pi]:\\\cases{x=3\cos u(1+\sin u)-(2-\cos u)\cos v,\cr
  33. y=8\sin u,\cr
  34. z=(2-\cos u)\sin v.\cr}$";
  35.  
  36. real h=0.0125;
  37.  
  38. begingroup3("parametrization");
  39. draw(surface(xscale(-0.38)*yscale(-0.18)*lo,s,0,1.7,h,bottom=false),
  40.      "[0,pi]");
  41. draw(surface(xscale(0.26)*yscale(0.1)*rotate(90)*hi,s,4.9,1.4,h,bottom=false),
  42.      "[pi,2pi]");
  43. endgroup3();
  44.  
  45. begingroup3("boundary");
  46. draw(s.uequals(0),blue+dashed);
  47. draw(s.uequals(pi),blue+dashed);
  48. endgroup3();
  49.  
  50. add(new void(frame f, transform3 t, picture pic, projection P) {
  51.     draw(f,invert(box(min(f,P),max(f,P)),P),"frame");
  52.   });
  53. \end{asy}
Advertisement
RAW Paste Data Copied
Advertisement