Annotation of Examples/PostScript/Rectangle.eps, revision 1.1

1.1     ! root        1: %!PS-Adobe-2.0 EPSF-2.0
        !             2: %%Title: Rectangle.eps
        !             3: %%Creator: Ali Ozer
        !             4: %%CreationDate: Tue Aug 14 10:38:47 1990
        !             5: %%Pages: 0 1
        !             6: %%BoundingBox: -5 0 600 792
        !             7: %%EndComments
        !             8: % Fun with scaling and rotating...
        !             9: % This program draws a rectangle over and over again while
        !            10: % slightly altering the scale and rotate values by a
        !            11: % fixed amount. This results in symmetric patterns.
        !            12: % Author: Ali Ozer, March 1989
        !            13: 
        !            14: % Initialize the random number generator
        !            15: % You can also seed the random number generator with
        !            16: % a constant number to get the same pattern everytime...
        !            17: usertime srand
        !            18: 
        !            19: % Random number generator 
        !            20: % a b randfloat generates one of 1000 numbers [a..b)
        !            21: /randfloat {              % start end
        !            22:   exch dup 3 1 roll       % start end start
        !            23:   sub                     % end-start
        !            24:   rand 1000 mod 1000 div  % 0 - 0.999
        !            25:   mul add              
        !            26: } bind def
        !            27: 
        !            28: % The drawing routine.
        !            29: /drawbox {
        !            30:   -100 -100 200 200 rectstroke
        !            31: } bind def
        !            32: 
        !            33: % Change the following for different pictures...
        !            34: /xscaleAmount 0.98 1.02 randfloat def
        !            35: /yscaleAmount 0.98 1.02 randfloat def
        !            36: /rotateAmount -3.0 3.0  randfloat def
        !            37: /numSteps 200 def   
        !            38: 
        !            39: % Come up towards the middle of a 8.5x11 (default) page
        !            40: 72 8.5 mul 2 div 72 11 mul 2 div translate
        !            41: 
        !            42: % Have thin lines (even when scaled; 0 linewidth
        !            43: % means "use the smallest line you can")
        !            44: 0 setlinewidth 
        !            45: 
        !            46: % Take numSteps steps from 1 to 0, drawing a
        !            47: % rectangle and altering the coordinate system
        !            48: % by the above values at every step...
        !            49: 
        !            50: 1 1 numSteps div neg 0 {
        !            51:   setgray
        !            52:   xscaleAmount yscaleAmount scale
        !            53:   rotateAmount rotate
        !            54:   drawbox
        !            55: } for
        !            56: 
        !            57: 
        !            58: %%EndFile

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.