home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Interactive Guide / c-cplusplus-interactive-guide.iso / c_ref / csource4 / 251_01 / list3.ps < prev    next >
Encoding:
Text File  |  1987-10-29  |  896 b   |  30 lines

  1.  
  2. %!
  3. % Produce Figure 4
  4. /inch {72 mul} def
  5. /width 4.54 inch def
  6. 50 400 translate
  7. width width scale % make square image of desired width
  8. /printerresolution
  9.   72 0 matrix defaultmatrix dtransform dup mul exch dup mul add sqrt
  10. def
  11. /screen printerresolution 16 div def
  12. screen 127 gt {/screen 127 def} if
  13. screen currentscreen 3 -1 roll pop setscreen
  14. /n width screen mul 72 div 2 sqrt mul 0.99 add cvi def % number of cells
  15. across image
  16. /nx n 2 mul def
  17. /ny n 2 idiv def
  18. /fbase 0.5 n mul 1.0 nx div exp def
  19. /fa 360  nx div fbase ln div def
  20. /c 1 def
  21. /cbase 0.003 1.0 ny div exp def
  22. /S nx string def
  23.  
  24. nx ny 8 [nx 0 0 ny 0 0]
  25. {/c c cbase mul def /f fa def
  26.   0 1 nx 1 sub{S exch f sin c mul 1.0 add 126.5 mul cvi put /f f fbase mul
  27. def}for
  28.   S}
  29. image
  30.  
  31. showpage
  32.  
  33.