home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l460 / 3.ddi / DEMOS.DI$ / CPLXDEMO.M < prev    next >
Encoding:
Text File  |  1993-03-07  |  1.5 KB  |  65 lines

  1. %CPLXDEMO Maps of functions of a complex variable.
  2.  
  3. %    Copyright (c) 1984-93 by The MathWorks, Inc.
  4.  
  5. disp(' ')
  6. disp(' ')
  7. disp('Functions of a complex variable, f(z).')
  8. disp('The domain is the unit disc, displayed in polar coordinates.')
  9. disp('The height of the surface is the real part, real(f(z)).')
  10. disp('The color of the surface is the imaginary part, imag(f(z)).')
  11. disp('The color map varies the hue in the HSV color model.')
  12. disp('There is a pause after each function; hit return to continue.')
  13. disp(' ')
  14.  
  15. clf
  16. colormap(hsv(64))
  17. z = cplxgrid(30);
  18.  
  19. cplxmap(z,z)
  20. title('z')
  21. disp('f(z) = z.')
  22. disp(' '), pause
  23.  
  24. disp('f(z) = z^3.  Three maxima at the cube roots of 1.')
  25. cplxmap(z,z.^3)
  26. title('z^3')
  27. disp(' '), pause
  28.  
  29. disp('f(z) = (z^4-1)^(1/4).  Four zeros at the fourth roots of 1.')
  30. cplxmap(z,(z.^4-1).^(1/4));
  31. title('(z^4-1)^(1/4)')
  32. disp(' '), pause
  33.  
  34. disp('f(z) = 1/z.  A simple pole at the origin.')
  35. cplxmap(z,1./(z+eps*(abs(z)==0)),5*pi)
  36. title('1/z')
  37. disp(' '), pause
  38.  
  39. disp('f(z) = atan(2*z).  Branch cut singularities at +-i/2. ')
  40. cplxmap(z,atan(2*z),1.9)
  41. title('atan(2*z)')
  42. disp(' '), pause
  43.  
  44. disp('f(z) = z^1/2.  Viewed from the negative imaginary axis.')
  45. axis('auto')
  46. cplxroot(2)
  47. view(0,0)
  48. title('sqrt(z)')
  49. disp(' '), pause
  50.  
  51. disp('f(z) = z^1/2.  Another view.  The Riemann surface for the square root.')
  52. view(-37.5,30)
  53. cplxroot(2)
  54. title('sqrt(z)')
  55. disp(' '), pause
  56.  
  57. disp('f(z) = z^1/3.  The Riemann surface for the cube root.')
  58. cplxroot(3)
  59. title('z^(1/3)')
  60. disp(' '), pause
  61.  
  62. spinmap
  63.  
  64. disp('End')
  65.