%!PS-Adobe-2.0 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % This Postscript is Copyright (c) 2003, Peter J Billam % % c/o P J B Computing, GPO Box 669, Hobart TAS 7001, Australia % % % % Permission is granted to any individual or institution to use, copy, % % modify or redistribute this software, so long as it is not resold for % % profit, and provided this notice is retained. Neither Peter Billam % % nor P J B Computing make any representations about the suitability % % of this software for any purpose. It is provided "as is", without any % % express or implied warranty. http://www.pjb.com.au % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Original of this is http://www.pjb.com.au/comp/free/sample4.ps.txt ... % See also http://www.pjb.com.au/comp/brownian.html ... %%EndComments %%BeginProlog % edit these lines to suit where brownian.ps and colours.ps are installed (/home/pjb/ps/lib/brownian.ps) run (/home/pjb/ps/lib/colours.ps) run %%EndProlog %%Page: 1 1 %%BeginPageSetup usertime realtime add srand %%EndPageSetup /Times-BoldItalic findfont 14 scalefont setfont 0.0 setgray 160 725 moveto (See www.pjb.com.au/comp/brownian.html) show % a brownian curve ... /x1 150 def /x2 550 def /y_scale 40 def /redness 1.3 def % 0=whitenoise, 1=pinknoise, 2=rednoise /n_harmonics 100 def /delta_x x2 x1 sub n_harmonics div 4 div def x1 x2 y_scale redness n_harmonics new_brownian_curve 30 585 moveto (redness = ) show redness ( ) cvs show 30 555 moveto (n_harmonics = ) show n_harmonics ( ) cvs show newpath x1 x1 brownian_curve 580 add moveto /x x1 delta_x add def { /y x brownian_curve 580 add def x y lineto /x x delta_x add def x x2 gt { exit } if } loop stroke % a brownian landscape ... /x1 150 def /x2 550 def /y1 100 def /y2 400 def /redness 3.5 def % 0=whitenoise, 1=pinknoise, 2=rednoise /z_scale 0.8 def /n_harmonics 20 def /delta x2 x1 sub n_harmonics div 4 div def x1 y1 x2 y2 z_scale redness n_harmonics new_brownian_landscape 30 255 moveto (redness = ) show redness ( ) cvs show 30 225 moveto (n_harmonics = ) show n_harmonics ( ) cvs show /x x1 def { % plot /y y1 def { /z x y brownian_landscape def newpath [ -1.0 blue 0.0 paleblue .4 white 1.0 mediumgrey ] z rgbinterpolate setrgbcolor x y delta dup rectfill /y y delta add def y y2 gt { exit } if } loop /x x delta add def x x2 gt { exit } if } loop showpage %%EOF