riemann.tst 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. %Demonstration file for some Riemann surfaces
  2. % Caroline Cotter, ZIB,Berlin, 1998
  3. %(with reference to paper:"Graphing Elementary Riemann Surfaces",
  4. % by Robert M. Corless & David J. Jeffrey, December 1997)
  5. load_package gnuplot;
  6. on complex;
  7. on demo;
  8. %The Riemann surface for w=arcsin(z)
  9. begin scalar w,x,y,z;
  10. w:=u+i*v;
  11. z:=sin(w);
  12. x:=repart(z); y:=impart(z);
  13. plot(point(x,y,u),u=(-pi ..pi),v=(-4 ..4),title=
  14. "The Arcsin Function",zlabel="u",view="75,50",points=30,hidden3d)
  15. end;
  16. %The Riemann surface for w=arccos(z)
  17. begin scalar w,x,y,z;
  18. w:=u+i*v;
  19. z:=cos(w);
  20. x:=repart(z); y:=impart(z);
  21. plot(point(x,y,u),u=(-pi ..pi),v=(-4 ..4),title=
  22. "The Arccos Function",zlabel="u",view="75,50",points=30,hidden3d)
  23. end;
  24. %The Riemann surface for w=arctan(z)
  25. begin scalar w,x,y,z;
  26. w:=u+i*v;
  27. z:=tan(w);
  28. x:=repart(z); y:=impart(z);
  29. plot(point(x,y,u),u=(-pi ..pi),v=(-2 ..2),title=
  30. "The Arctan Function",zlabel="u",view="80,30",points=40)
  31. end;
  32. %The Riemann surface for w=z^(1/2)
  33. %(a) With Cartesian coordinates parameterization
  34. begin scalar w,x,y,z;
  35. w:=u+i*v;
  36. z:=w^2;
  37. x:=repart(z); y:=impart(z);
  38. plot(point(x,y,v),u=(-2 ..2),v=(-2 ..2), title=
  39. "The Squareroot Function (a)",zlabel="v",view="60,60",points=30,hidden3d)
  40. end;
  41. %(b) With polar coordinates parameterization
  42. begin scalar w,x,y;
  43. w:=r*cos(theta) + i*r*sin(theta);
  44. x:=r^2*cos(2*theta);
  45. y:=r^2*sin(2*theta);
  46. plot(point(x,y,impart(w)),r=(0 .. 1.5),theta=(-2*pi ..2*pi),
  47. title="The Squareroot Function (b)",view="70,50",points=50,hidden3d)
  48. end;
  49. %The Riemann surface for w=z^(1/3)
  50. %(a) With Cartesian coordinates parameterization
  51. begin scalar w,x,y,z;
  52. w:=u+i*v;
  53. z:=w^3;
  54. x:=repart(z); y:=impart(z);
  55. plot(point(x,y,v),u=(-2 ..2),v=(-2 ..2),
  56. title="The Cuberoot Function (a)",zlabel="v",view="50,60",hidden3d)
  57. end;
  58. %(b) With polar coordinates parameterization
  59. begin scalar w,x,y;
  60. w:=r*cos(theta) + i*r*sin(theta);
  61. x:=r^3*cos(3*theta);
  62. y:=r^3*sin(3*theta);
  63. plot(point(x,y,impart(w)),r=(0 .. 1.5),theta=(-2*pi ..2*pi),
  64. title="The Cuberoot Function (b)",view="70,100",points=50,hidden3d)
  65. end;
  66. %The Riemann surface for w=z^(2/3)
  67. begin scalar w,x,y;
  68. w:=r*cos(theta) + i*r*sin(theta);
  69. x:=r^(3/2)*cos((3/2)*theta);
  70. y:=r^(3/2)*sin((3/2)*theta);
  71. plot(point(x,y,impart(w)),r=(0 .. 1.5),theta=(-2*pi ..2*pi),
  72. title="The Cuberoot-squared Function",view="65,280",points=40,hidden3d)
  73. end;