home *** CD-ROM | disk | FTP | other *** search
- defineps doTree(float maxdepth, leftBranch, rightBranch, branchLength, moveRight, scaleX, scaleY, lineWidth, branchChange, widthChange)
-
- %! From pg 74 of the "Blue Book"
-
- /depth 0 def
- /down {/depth depth 1 add def} def
- /up {/depth depth 1 sub def} def
- /doLine % Vertical line
- {0 branchLength rlineto currentpoint stroke translate 0 0 moveto}
- def
- /fractArrow
- {gsave branchChange widthChange scale lineWidth setlinewidth
- down doLine
- depth maxdepth le
- {leftBranch neg rotate fractArrow rightBranch neg rotate fractArrow}
- if
- up grestore}
- def
-
-
- % "Main" program
- moveRight 0 moveto scaleX scaleY scale fractArrow 0.5 setgray stroke
- showpage
-
- endps
-
-
-