%!PS %%Version: 3.3.1 %%DocumentFonts: (atend) %%Pages: (atend) %%EndComments % % Version 3.3.1 prologue for troff files. % /#copies 1 store /aspectratio 1 def /formsperpage 1 def /landscape false def /linewidth .3 def /magnification 1 def /margin 0 def /orientation 0 def /resolution 720 def /rotation 1 def /xoffset 0 def /yoffset 0 def /roundpage true def /useclippath true def /pagebbox [0 0 612 792] def /R /Times-Roman def /I /Times-Italic def /B /Times-Bold def /BI /Times-BoldItalic def /H /Helvetica def /HI /Helvetica-Oblique def /HB /Helvetica-Bold def /HX /Helvetica-BoldOblique def /CW /Courier def /CO /Courier def /CI /Courier-Oblique def /CB /Courier-Bold def /CX /Courier-BoldOblique def /PA /Palatino-Roman def /PI /Palatino-Italic def /PB /Palatino-Bold def /PX /Palatino-BoldItalic def /Hr /Helvetica-Narrow def /Hi /Helvetica-Narrow-Oblique def /Hb /Helvetica-Narrow-Bold def /Hx /Helvetica-Narrow-BoldOblique def /KR /Bookman-Light def /KI /Bookman-LightItalic def /KB /Bookman-Demi def /KX /Bookman-DemiItalic def /AR /AvantGarde-Book def /AI /AvantGarde-BookOblique def /AB /AvantGarde-Demi def /AX /AvantGarde-DemiOblique def /NR /NewCenturySchlbk-Roman def /NI /NewCenturySchlbk-Italic def /NB /NewCenturySchlbk-Bold def /NX /NewCenturySchlbk-BoldItalic def /ZD /ZapfDingbats def /ZI /ZapfChancery-MediumItalic def /S /S def /S1 /S1 def /GR /Symbol def /inch {72 mul} bind def /min {2 copy gt {exch} if pop} bind def /setup { counttomark 2 idiv {def} repeat pop landscape {/orientation 90 orientation add def} if /scaling 72 resolution div def linewidth setlinewidth 1 setlinecap pagedimensions xcenter ycenter translate orientation rotation mul rotate width 2 div neg height 2 div translate xoffset inch yoffset inch neg translate margin 2 div dup neg translate magnification dup aspectratio mul scale scaling scaling scale addmetrics 0 0 moveto } def /pagedimensions { useclippath userdict /gotpagebbox known not and { /pagebbox [clippath pathbbox newpath] def roundpage currentdict /roundpagebbox known and {roundpagebbox} if } if pagebbox aload pop 4 -1 roll exch 4 1 roll 4 copy landscape {4 2 roll} if sub /width exch def sub /height exch def add 2 div /xcenter exch def add 2 div /ycenter exch def userdict /gotpagebbox true put } def /addmetrics { /Symbol /S null Sdefs cf /Times-Roman /S1 StandardEncoding dup length array copy S1defs cf } def /pagesetup { /page exch def currentdict /pagedict known currentdict page known and { page load pagedict exch get cvx exec } if } def /decodingdefs [ {counttomark 2 idiv {y moveto show} repeat} {neg /y exch def counttomark 2 idiv {y moveto show} repeat} {neg moveto {2 index stringwidth pop sub exch div 0 32 4 -1 roll widthshow} repeat} {neg moveto {spacewidth sub 0.0 32 4 -1 roll widthshow} repeat} {counttomark 2 idiv {y moveto show} repeat} {neg setfunnytext} ] def /setdecoding {/t decodingdefs 3 -1 roll get bind def} bind def /w {neg moveto show} bind def /m {neg dup /y exch def moveto} bind def /done {/lastpage where {pop lastpage} if} def /f { dup /font exch def findfont exch dup /ptsize exch def scaling div dup /size exch def scalefont setfont linewidth ptsize mul scaling 10 mul div setlinewidth /spacewidth ( ) stringwidth pop def } bind def /changefont { /fontheight exch def /fontslant exch def currentfont [ 1 0 fontheight ptsize div fontslant sin mul fontslant cos div fontheight ptsize div 0 0 ] makefont setfont } bind def /sf {f} bind def /cf { dup length 2 idiv /entries exch def /chtab exch def /newencoding exch def /newfont exch def findfont dup length 1 add dict /newdict exch def {1 index /FID ne {newdict 3 1 roll put}{pop pop} ifelse} forall newencoding type /arraytype eq {newdict /Encoding newencoding put} if newdict /Metrics entries dict put newdict /Metrics get begin chtab aload pop 1 1 entries {pop def} for newfont newdict definefont pop end } bind def % % A few arrays used to adjust reference points and character widths in some % of the printer resident fonts. If square roots are too high try changing % the lines describing /radical and /radicalex to, % % /radical [0 -75 550 0] % /radicalex [-50 -75 500 0] % % Move braceleftbt a bit - default PostScript character is off a bit. % /Sdefs [ /bracketlefttp [201 500] /bracketleftbt [201 500] /bracketrighttp [-81 380] /bracketrightbt [-83 380] /braceleftbt [203 490] /bracketrightex [220 -125 500 0] /radical [0 0 550 0] /radicalex [-50 0 500 0] /parenleftex [-20 -170 0 0] /integral [100 -50 500 0] /infinity [10 -75 730 0] ] def /S1defs [ /underscore [0 80 500 0] /endash [7 90 650 0] ] def % % Tries to round clipping path dimensions, as stored in array pagebbox, so they % match one of the known sizes in the papersizes array. Lower left coordinates % are always set to 0. % /roundpagebbox { 7 dict begin /papersizes [8.5 inch 11 inch 14 inch 17 inch] def /mappapersize { /val exch def /slop .5 inch def /diff slop def /j 0 def 0 1 papersizes length 1 sub { /i exch def papersizes i get val sub abs dup diff le {/diff exch def /j i def} {pop} ifelse } for diff slop lt {papersizes j get} {val} ifelse } def pagebbox 0 0 put pagebbox 1 0 put pagebbox dup 2 get mappapersize 2 exch put pagebbox dup 3 get mappapersize 3 exch put end } bind def %%EndProlog %%BeginSetup mark /resolution 720 def setup 2 setdecoding %%EndSetup %%Page: 0 1 /saveobj save def mark 1 pagesetup 10 PA f (AT&T Bell Laboratories)2 1053 1 2353 1740 t (Murray Hill, New Jersey 07974)4 1367 1 2196 1860 t (Computing Science Technical Report No. 103)5 1996 1 1882 3180 t 10 PB f (IDEAL)2305 3450 w 12 PB f (User's Manual)1 797 1 2657 3450 t 10 PI f (Christopher J. Van Wyk)3 971 1 2394 3690 t 10 PA f (December 17, 1981)2 823 1 720 6240 t cleartomark showpage saveobj restore %%EndPage: 0 1 %%Page: 0 2 /saveobj save def mark 2 pagesetup 10 PB f (IDEAL)2305 1230 w 12 PB f (User's Manual)1 797 1 2657 1230 t 10 PI f (Christopher J. Van Wyk)3 971 1 2394 1470 t 10 PA f (AT&T Bell Laboratories)2 1053 1 2353 1650 t (Murray Hill, New Jersey 07974)4 1367 1 2196 1770 t 10 PI f (ABSTRACT)2621 2270 w 8 PA f (IDEAL)1330 2530 w 10 PA f (is a programming language to be used for describing pictures.)9 2746 1 1604 2530 t (The main use of)3 741 1 1330 2686 t 8 PA f (IDEAL)2108 2686 w 10 PA f (is as a preprocessor to)4 1023 1 2394 2686 t 8 PA f (TROFF)3454 2686 w 10 PA f ( and)1 207(, so that pictures)3 763 2 3710 2686 t ( manual contains)2 776( This)1 251( same file and be typeset together.)6 1571(text may reside in the)4 1002 4 1080 2806 t (many examples of this use of)5 1282 1 1080 2926 t 8 PA f (IDEAL)2387 2926 w 10 PA f (.)2636 2926 w 8 PA f (IDEAL)1330 3082 w 10 PA f ( so pic-)2 323(proper produces device-independent descriptions of pictures,)5 2749 2 1608 3082 t (tures may also be displayed through the)6 1781 1 1080 3202 t 9 PA f (UNIX)2884 3202 w 10 S f (\322)3120 3202 w 10 PA f (plot filters.)1 481 1 3224 3202 t (This document describes how to use the existing implementation of)9 2985 1 1330 3358 t 8 PA f (IDEAL)4340 3358 w 10 PA f (.)4589 3358 w (December 17, 1981)2 823 1 720 3838 t cleartomark showpage saveobj restore %%EndPage: 0 2 %%Page: 1 3 /saveobj save def mark 3 pagesetup 10 PB f (IDEAL)2305 1230 w 12 PB f (User's Manual)1 797 1 2657 1230 t 10 PI f (Christopher J. Van Wyk)3 971 1 2394 1470 t 10 PA f (AT&T Bell Laboratories)2 1053 1 2353 1650 t (Murray Hill, New Jersey 07974)4 1367 1 2196 1770 t 10 PB f (1. Introduction)1 702 1 720 2130 t 8 PA f (IDEAL)970 2286 w 10 PA f ( intended primarily to operate as a prepro-)7 1927( is)1 100( It)1 121(is a language for describing pictures.)5 1644 4 1248 2286 t (cessor to)1 384 1 720 2406 t 8 PA f (TROFF)1129 2406 w 10 PA f ([3], much like)2 603 1 1385 2406 t 8 PA f (EQN TBL)1 345 1 2013 2406 t 10 PA f ([2],)2358 2406 w 8 PA f (REFER)2519 2406 w 10 PA f ([0], and)1 335 1 2770 2406 t 8 PA f (PIC)3130 2406 w 10 PA f (I have explained the principles that motivate the form of)9 2592 1 970 2562 t 8 PA f (IDEAL)3599 2562 w 10 PA f (elsewhere This document)2 1155 1 3885 2562 t (describes how to use the existing implementation of)7 2298 1 720 2682 t 8 PA f (IDEAL)3043 2682 w 10 PA f (and treats several examples in depth.)5 1642 1 3317 2682 t 9 PA f ( be skipped on first reading: they present)7 1686(Paragraphs like this that appear in smaller type may)8 2134 2 970 2828 t (sidelights that may be ignored safely by beginners.)7 2026 1 970 2938 t 10 PB f ( of)1 120(2. Overview)1 575 2 720 3214 t 8 PB f (IDEAL)1440 3214 w 10 PA f (To take advantage of)3 928 1 970 3370 t 8 PA f (IDEAL)1923 3370 w 10 PA f ('s capabilities, you must believe that)5 1599 1 2172 3370 t 10 PI f (complex numbers are good)3 1068 1 2329 3490 t 10 PA f (.)3405 3490 w 10 S f (\267)720 3646 w 10 PA f ( to points in the Cartesian \()6 1249(Complex numbers have a natural correspondence)5 2242 2 970 3646 t 10 PI f (x)4461 3646 w 10 S f (-)4535 3646 w 10 PI f (y)4606 3646 w 10 PA f (\) coordi-)1 384 1 4656 3646 t (nate system.)1 548 1 970 3766 t 10 S f (\267)720 3922 w 10 PA f ( numbers obviates the need for distinguishing between ``points'' and)9 3370(Using complex)1 700 2 970 3922 t (``dimensions.'')970 4042 w 10 S f (\267)720 4198 w 10 PA f ( operations as translation, rotation, and)5 1826(Complex numbers capture readily such common)5 2244 2 970 4198 t (reflection in the plane.)3 988 1 970 4318 t 8 PA f (IDEAL)720 4474 w 10 PA f (programs define pictures by means of a system of simultaneous equations in the significant)13 4046 1 994 4474 t ( those)1 275(points of the picture and a set of drawing instructions to be carried out with respect to)16 4045 2 720 4594 t (points.)720 4714 w 8 PA f (IDEAL)1073 4714 w 10 PA f ( points so deter-)3 748(solves the system of equations, then draws the picture using the)10 2934 2 1358 4714 t (mined.)720 4834 w (All variables in)2 672 1 970 4990 t 8 PA f (IDEAL)1667 4990 w 10 PA f (programs are complex numbers, with the usual operations:)7 2614 1 1941 4990 t 10 S f (\267)720 5146 w 10 PA f (component-wise addition and subtraction: \()4 1936 1 970 5146 t 10 PI f (a)2914 5146 w 10 PA f (,)2966 5146 w 10 PI f (b)2999 5146 w 10 PA f (\))3053 5146 w 10 S f (\261)3135 5146 w 10 PA f (\()3231 5146 w 10 PI f (c)3272 5146 w 10 PA f (,)3321 5146 w 10 PI f (d)3354 5146 w 10 PA f (\))3412 5146 w 10 S f (=)3502 5146 w 10 PA f (\()3606 5146 w 10 PI f (a)3647 5146 w 10 S f (\261)3699 5146 w 10 PI f (c)3762 5146 w 10 PA f (,)3811 5146 w 10 PI f (b)3844 5146 w 10 S f (\261)3898 5146 w 10 PI f (d)3961 5146 w 10 PA f (\))4019 5146 w 10 S f (\267)720 5302 w 10 PA f (vector multiplication: \()2 1010 1 970 5302 t 10 PI f (a)1988 5302 w 10 PA f (,)2040 5302 w 10 PI f (b)2073 5302 w 10 PA f (\))2127 5302 w 10 PI f (*)2176 5302 w 10 PA f (\()2223 5302 w 10 PI f (c)2264 5302 w 10 PA f (,)2313 5302 w 10 PI f (d)2346 5302 w 10 PA f (\))2404 5302 w 10 S f (=)2494 5302 w 10 PA f (\()2598 5302 w 10 PI f (ac)2639 5302 w 10 S f (-)2748 5302 w 10 PI f (bd)2819 5302 w 10 PA f (,)2923 5302 w 10 PI f (ad)2956 5302 w 10 S f (+)3074 5302 w 10 PI f (bc)3145 5302 w 10 PA f (\))3240 5302 w 10 S f (\267)720 5458 w 10 PA f (vector division: \()2 743 1 970 5458 t 10 PI f (a)1721 5458 w 10 PA f (,)1773 5458 w 10 PI f (b)1806 5458 w 10 PA f (\))1860 5458 w 10 PI f (/)1901 5458 w 10 PA f (\()1939 5458 w 10 PI f (c)1980 5458 w 10 PA f (,)2029 5458 w 10 PI f (d)2062 5458 w 10 PA f (\))2120 5458 w 10 S f (=)2210 5458 w 10 PA f (\()2314 5458 w 10 PI f (ac)2355 5458 w 10 S f (+)2464 5458 w 10 PI f (bd)2535 5458 w 10 PA f (,)2639 5458 w 10 S f (-)2680 5458 w 10 PI f (ad)2751 5458 w 10 S f (+)2869 5458 w 10 PI f (bc)2940 5458 w 10 PA f (\))3035 5458 w 10 PI f (/)3076 5458 w 10 PA f (\()3114 5458 w 10 PI f (c)3155 5458 w 7 PA f (2)3207 5418 w 10 S f (+)3266 5458 w 10 PI f (d)3337 5458 w 7 PA f (2)3398 5418 w 10 PA f (\))3449 5458 w 10 S f (\267)720 5614 w 10 PA f ( \( \()2 82(component manipulation: re)2 1261 2 970 5614 t 10 PI f (a)2321 5614 w 10 PA f (,)2373 5614 w 10 PI f (b)2406 5614 w 10 PA f (\) \))1 74 1 2460 5614 t 10 S f (=)2591 5614 w 10 PI f (a)2695 5614 w 10 PA f ( \( \()2 82(, im)1 167 2 2739 5614 t 10 PI f (a)2996 5614 w 10 PA f (,)3048 5614 w 10 PI f (b)3081 5614 w 10 PA f (\) \))1 74 1 3135 5614 t 10 S f (=)3266 5614 w 10 PI f (b)3370 5614 w 10 PA f ( \( \()2 82(, and conj)2 424 2 3416 5614 t 10 PI f (a)3930 5614 w 10 PA f (,)3982 5614 w 10 PI f (b)4015 5614 w 10 PA f (\) \))1 74 1 4069 5614 t 10 S f (=)4200 5614 w 10 PA f (\()4304 5614 w 10 PI f (a)4345 5614 w 10 PA f (,)4397 5614 w 10 S f (-)4438 5614 w 10 PI f (b)4509 5614 w 10 PA f (\))4563 5614 w 10 S f (\267)720 5788 w 10 PA f ( \( \()2 82(vector magnitude calculation: abs)3 1487 2 970 5788 t 10 PI f (a)2547 5788 w 10 PA f (,)2599 5788 w 10 PI f (b)2632 5788 w 10 PA f (\) \))1 74 1 2686 5788 t 10 S f (=)2817 5788 w 12 S f (\326` `````)1 367 1 2921 5788 t 10 PI f (a)2995 5788 w 7 PA f (2)3050 5748 w 10 S f (+)3109 5788 w 10 PI f (b)3180 5788 w 7 PA f (2)3237 5748 w 10 S f (\267)720 5944 w 10 PA f ( \()1 41(unit vector function: cis)3 1041 2 970 5944 t 10 S f (q)2060 5944 w 10 PA f (\))2120 5944 w 10 S f (=)2210 5944 w 10 PA f (cos)2314 5944 w 10 S f (q +)1 123 1 2463 5944 t 10 PI f (i)2602 5944 w 10 PA f (sin)2638 5944 w 10 S f (q)2775 5944 w 10 PA f ( notation that has proved useful is)6 1646(A non-standard)1 724 2 720 6100 t 10 S f (a)3138 6100 w 10 PA f ([)3209 6100 w 10 PI f (x)3250 6100 w 10 PA f (,)3308 6100 w 10 PI f (y)3341 6100 w 10 PA f (], for complex)2 658 1 3399 6100 t 10 PI f (x)4105 6100 w 10 PA f (and)4203 6100 w 10 PI f (y)4420 6100 w 10 PA f (, defined by)2 570 1 4470 6100 t 10 PI f (x)720 6220 w 10 S f (+ a)1 134 1 794 6220 t 10 PA f (\()936 6220 w 10 PI f (y)977 6220 w 10 S f (-)1051 6220 w 10 PI f (x)1122 6220 w 10 PA f (\), and meaning ``)3 745 1 1180 6220 t 10 S f (a)1925 6220 w 10 PA f (of the way from)3 707 1 2013 6220 t 10 PI f (x)2745 6220 w 10 PA f (to)2820 6220 w 10 PI f (y)2933 6220 w 10 PA f (.'')2983 6220 w ( example, ``1'' is treated)4 1078( For)1 208(Scalars are treated as vectors with null imaginary component.)8 2784 3 970 6376 t (as ``\(1,0\).'')1 445 1 720 6496 t ( system in which)3 755(The scale of the coordinate)4 1192 2 970 6652 t 8 PA f (IDEAL)2941 6652 w 10 PA f (programs are written is entirely a matter)6 1821 1 3219 6652 t ( The)1 227(of convenience.)1 694 2 720 6772 t 8 PA f (IDEAL)1676 6772 w 10 PA f ( coordinate system as)3 976(processor proper produces output in the same)6 2104 2 1960 6772 t ( for the device on)4 786( \(``filters''\) scale this coordinate system to make sense)8 2389( Postprocessors)1 712(the input.)1 433 4 720 6892 t (which the picture is displayed.)4 1357 1 720 7012 t ( of the)2 281( Some)1 296( to the associated programs.)4 1245(Some of the pictures below include captions keyed)7 2248 4 970 7168 t ( labels are)2 441( Such)1 265( program: I added them to help explain the picture.)9 2268(labels are not produced by the)5 1346 4 720 7288 t cleartomark showpage saveobj restore %%EndPage: 1 3 %%Page: 2 4 /saveobj save def mark 4 pagesetup 10 PA f (- 2 -)2 166 1 2797 480 t ( pictures and programs that have not been labeled, you may find that labeling)13 3467(parenthesized. For)1 853 2 720 840 t (them yourself helps you understand the program.)6 2212 1 720 960 t 10 PB f ( of the)2 289(3. Elements)1 546 2 720 1200 t 8 PB f (IDEAL)1580 1200 w 10 PB f (Language)1862 1200 w 10 PA f ( fundamental units of)3 965(This section presents statements that make up the)7 2216 2 970 1356 t 8 PA f (IDEAL)4180 1356 w 10 PA f (programs, so)1 582 1 4458 1356 t ( that appears)2 630( Text)1 272(the displayed program text represents fragments of complete programs.)8 3418 3 720 1476 t (between)720 1596 w 10 PI f (/ *)1 77 1 1118 1596 t 10 PA f (and)1220 1596 w 10 PI f (* /)1 77 1 1414 1596 t 10 PA f (is a comment.)2 610 1 1516 1596 t 10 PB f (3.1. Boxes)1 467 1 720 1836 t 10 PA f (The building blocks of)3 1024 1 970 1992 t 8 PA f (IDEAL)2031 1992 w 10 PA f (programs are called)2 904 1 2317 1992 t 10 PI f (boxes)3259 1992 w 10 PA f (, which readers familiar with pro-)5 1555 1 3485 1992 t ( fact, the picture drawn by an)6 1299( In)1 142( procedures or subroutines.)3 1215(gramming may think of as)4 1177 4 720 2112 t 8 PA f (IDEAL)4578 2112 w 10 PA f (pro-)4852 2112 w (gram must itself be a box, called)6 1464 1 720 2232 t 10 PI f (main)2216 2232 w 10 PA f ( for all of Sec-)4 634(; we suppress this extra level of box-nesting)7 1976 2 2430 2232 t (tion 3.)1 275 1 720 2352 t 10 PB f ( Boxes)1 292(3.1.1. Defining)1 691 2 720 2592 t 10 PA f (Here is a simple box and one instance of it:)9 1890 1 970 2748 t (\(ne\))3805 2868 w (\(se\))3805 3048 w (\(nw\))3188 2868 w (\(sw\))3204 3048 w 10 S1 f (_ _______)1 360 1 3420 2868 t 10 S f (\347)3420 3048 w (\347)3420 2968 w 10 S1 f (_ _______)1 360 1 3420 3048 t 10 S f (\347)3780 2968 w (\347)3780 3048 w 9 CW f (rect {)1 324 1 1080 2918 t (var ne, nw, se, sw,)4 1026 1 1512 3028 t (wd, ht;)1 378 1 1944 3138 t (nw = sw + \(0,1\)*ht;)4 1026 1 1512 3248 t (ne = nw + wd;)4 702 1 1512 3358 t (se = sw + wd;)4 702 1 1512 3468 t (conn ne to nw to sw to se to ne;)9 1728 1 1512 3578 t (})1080 3688 w 10 PA f (It is called)2 455 1 720 3904 t 10 PI f (rect)1203 3904 w 10 PA f (, has six local complex variables:)5 1445 1 1363 3904 t 10 PI f (ne)2836 3904 w 10 PA f (,)2939 3904 w 10 PI f (nw)2992 3904 w 10 PA f (,)3128 3904 w 10 PI f (se)3181 3904 w 10 PA f (,)3267 3904 w 10 PI f (sw)3320 3904 w 10 PA f (,)3439 3904 w 10 PI f (wd)3492 3904 w 10 PA f (, and)1 222 1 3622 3904 t 10 PI f (ht)3872 3904 w 10 PA f (, three equations among)3 1077 1 3963 3904 t (these variables, and an instruction to draw four lines.)8 2352 1 720 4024 t 10 PB f ( Boxes)1 292(3.1.2. Placing)1 613 2 720 4264 t 10 PA f (To ask for an instance of)5 1140 1 970 4420 t 10 PI f (rect)2148 4420 w 10 PA f (, we use a)3 470 1 2308 4420 t 10 PI f (put)2816 4420 w 10 PA f (statement with a)2 762 1 3001 4420 t 10 PI f (parameter section)1 723 1 3801 4420 t 10 PA f (containing)4570 4420 w ( variables of this instance of)5 1354(enough additional equations that the local)5 2001 2 720 4540 t 10 PI f (rect)4126 4540 w 10 PA f (are determined)1 703 1 4337 4540 t ( \()1 69( example, we might give the dimensions)6 1843(uniquely. For)1 632 3 720 4660 t 10 PI f (ht)3264 4660 w 10 PA f (and)3391 4660 w 10 PI f (wd)3596 4660 w 10 PA f (\) and one of the corners \(say)6 1314 1 3726 4660 t 10 PI f (sw)720 4780 w 10 PA f (\):)839 4780 w 10 S1 f (_ ___)1 180 1 3510 4900 t 10 S f (\347)3510 5260 w (\347)3510 5200 w (\347)3510 5100 w (\347)3510 5000 w 10 S1 f (_ ___)1 180 1 3510 5260 t 10 S f (\347)3690 5000 w (\347)3690 5060 w (\347)3690 5160 w (\347)3690 5260 w 9 CW f (put rect {)2 540 1 1080 4950 t (ht = 2;)2 378 1 1512 5060 t (wd = 1;)2 378 1 1512 5170 t (sw = 0;)2 378 1 1512 5280 t (};)1080 5390 w 10 PA f ( rectangle: \(C programmers will recog-)5 1723(Any of the following put statements would draw the same)9 2597 2 720 5570 t (nize the)1 349 1 720 5690 t 10 PI f (/ *)1 77 1 1094 5690 t 10 PA f (and)1196 5690 w 10 PI f (* /)1 77 1 1390 5690 t 10 PA f (comment brackets.\))1 865 1 1492 5690 t 9 CW f (/* giving one corner, one dimension)5 1890 1 1080 5860 t (and a relation on the dimensions */)6 1890 1 1242 5970 t (put rect {)2 540 1 1080 6080 t (ht = 2;)2 378 1 1512 6190 t (wd = 0.5*ht;)2 648 1 1512 6300 t (nw = \(0,2\);)2 594 1 1512 6410 t (};)1080 6520 w cleartomark showpage saveobj restore %%EndPage: 2 4 %%Page: 3 5 /saveobj save def mark 5 pagesetup 10 PA f (- 3 -)2 166 1 2797 480 t 9 CW f (/* giving two adjacent corners)4 1620 1 1080 890 t (and the perpendicular dimension */)4 1836 1 1242 1000 t (put rect {)2 540 1 1080 1110 t (nw = \(0,2\);)2 594 1 1512 1220 t (sw = 0;)2 378 1 1512 1330 t (wd = 1;)2 378 1 1512 1440 t (};)1080 1550 w (/* giving two diagonal corners)4 1620 1 1080 1780 t (and a relation on the dimensions */)6 1890 1 1242 1890 t (put rect {)2 540 1 1080 2000 t (ne = \(1,2\);)2 594 1 1512 2110 t (sw = 0;)2 378 1 1512 2220 t (wd = 0.5*ht;)2 648 1 1512 2330 t (};)1080 2440 w (/* giving three corners */)4 1404 1 1080 2670 t (put rect {)2 540 1 1080 2780 t (ne = \(1,2\);)2 594 1 1512 2890 t (nw = \(0,2\);)2 594 1 1512 3000 t (se = 1;)2 378 1 1512 3110 t (};)1080 3220 w (/* giving the center of a side,)6 1674 1 1080 3450 t (a corner, and another dimension */)5 1836 1 1242 3560 t (put rect {)2 540 1 1080 3670 t (\(nw+sw\)/2 = \(0,1\);)2 972 1 1512 3780 t (nw = \(0,2\);)2 594 1 1512 3890 t (wd = 1;)2 378 1 1512 4000 t (};)1080 4110 w 10 PA f (The put statement is to)4 1028 1 720 4326 t 8 PA f (IDEAL)1777 4326 w 10 PA f ( procedure call is to a conventional programming language.)8 2682(what a)1 303 2 2055 4326 t ( variables of a box must be speci\256ed to be a parameter whose)12 2810(The difference is that none of the)6 1510 2 720 4446 t ( box's variables may be set by the put statement, and)10 2481(value is expected in any call: any of the)8 1839 2 720 4566 t 8 PA f (IDEAL)720 4686 w 10 PA f ( means)1 316( This)1 245( equations in the de\256nition of the box.)7 1713(will determine the rest by means of the)7 1766 4 1000 4686 t ( about this instance of the box, as long as it is enough)12 2365(we can give whatever information we know)6 1955 2 720 4806 t ( want to set down)4 808( mechanism is useful because we often)6 1733( This)1 245(to determine everything uniquely.)3 1534 4 720 4926 t ( corner each time; in a con-)6 1233(a rectangle by giving one of its corners, but not necessarily the same)12 3087 2 720 5046 t ( we would need to provide a different procedure for each cor-)11 2790(ventional programming language,)2 1530 2 720 5166 t ( the put state-)3 615( certainly, not all of)4 862( \(Almost)1 410(ner, and the code to solve for the other corners from it.)11 2433 4 720 5286 t (ments above are equally useful; but it is good to be able to use any of them when the need arises.\))20 4304 1 720 5406 t 9 PA f (Here is how)2 492 1 970 5552 t 7 PA f (IDEAL)1489 5552 w 9 PA f (solves the system of equations implicit in a program: First, all equations are)12 3055 1 1735 5552 t ( to these equations may\320and prob-)5 1430( time a box is called, the solutions)7 1356( Every)1 282(placed on a queue.)3 752 4 970 5662 t (ably will\320be different, so all the equations of a box are enqueued separately for each time that)16 3820 1 970 5772 t ( the variable,)2 523( course, different copies of the equation refer to different copies of)11 2687( \(Of)1 182(box is put.)2 428 4 970 5882 t (but)970 5992 w 7 PA f (IDEAL)1142 5992 w 9 PA f ( processing,)1 489( During)1 349( straight.\))1 399(keeps that)1 423 4 1399 5992 t 7 PA f (IDEAL)3098 5992 w 9 PA f (maintains two classes of variables:)4 1434 1 3356 5992 t ( dependent variable is represented as a linear combination of)9 2428( Each)1 238( independent.)1 551(dependent and)1 603 4 970 6102 t ( whose values are known are a trivial)7 1563( \(Variables)1 461( constant term.)2 616(independent variables plus a)3 1180 4 970 6212 t ( long as there are equa-)5 971( As)1 163( variables start out independent.)4 1328( All)1 177(case of dependent variables.\))3 1181 5 970 6322 t (tions on the queue,)3 789 1 970 6432 t 7 PA f (IDEAL)1792 6432 w 9 PA f ( all dependent)2 592(examines the head equation: if, after substituting for)7 2154 2 2044 6432 t (variables, the equation is linear,)4 1288 1 970 6542 t 7 PA f (IDEAL)2287 6542 w 9 PA f ( from it if possible\320that is,)5 1106(determines new information)2 1149 2 2535 6542 t 7 PA f (IDEAL)970 6652 w 9 PA f ( the number of inde-)4 857(tries to make one variable dependent on the others, thus reducing)10 2712 2 1221 6652 t ( remains)1 347(pendent variables\320or decides whether it is redundant or inconsistent; if the equation)11 3473 2 970 6762 t ( substitution,)1 529(non-linear after)1 623 2 970 6872 t 7 PA f (IDEAL)2145 6872 w 9 PA f ( If)1 112(adds it to the end of the queue and proceeds.)9 1839 2 2392 6872 t 7 PA f (IDEAL)4371 6872 w 9 PA f (ever)4618 6872 w ( cannot be)2 412(goes through the whole queue without discovering any new information, the system)11 3408 2 970 6982 t (solved \(by)1 416 1 970 7092 t 7 PA f (IDEAL)1410 7092 w 9 PA f (, anyway\) and)2 570 1 1629 7092 t 7 PA f (IDEAL)2224 7092 w 9 PA f ( there are any independent variables)5 1464( If)1 109(complains bitterly.)1 749 3 2468 7092 t (left after this processing,)3 1020 1 970 7202 t 7 PA f (IDEAL)2027 7202 w 9 PA f (will complain too, because there is no way they can become)10 2508 1 2282 7202 t cleartomark showpage saveobj restore %%EndPage: 3 5 %%Page: 4 6 /saveobj save def mark 6 pagesetup 9 PA f (- 4 -)2 151 1 2804 470 t (known.)970 830 w 10 PA f (The variables)1 596 1 970 1022 t 10 PI f (wd)1597 1022 w 10 PA f (and)1758 1022 w 10 PI f (ht)1958 1022 w 10 PA f (above are complex numbers just like the corners, so we can rotate)11 2960 1 2080 1022 t (the rectangle by giving them complex non-real values:)7 2399 1 720 1142 t cleartomark saveobj restore %%BeginGlobal % % Version 3.3.1 drawing procedures for dpost. Automatically pulled in when % needed. % /inpath false def /savematrix matrix def /Dl { inpath {pop pop neg lineto} {newpath neg moveto neg lineto stroke} ifelse } bind def /De { /y1 exch 2 div def /x1 exch 2 div def /savematrix savematrix currentmatrix def neg exch x1 add exch translate x1 y1 scale 0 0 1 0 360 inpath {1 0 moveto arc savematrix setmatrix} {newpath arc savematrix setmatrix stroke} ifelse } bind def /Da { /dy2 exch def /dx2 exch def /dy1 exch def /dx1 exch def dy1 add neg exch dx1 add exch dx1 dx1 mul dy1 dy1 mul add sqrt dy1 dx1 neg atan dy2 neg dx2 atan inpath {arc} {newpath arc stroke} ifelse } bind def /DA { /dy2 exch def /dx2 exch def /dy1 exch def /dx1 exch def dy1 add neg exch dx1 add exch dx1 dx1 mul dy1 dy1 mul add sqrt dy1 dx1 neg atan dy2 neg dx2 atan inpath {arcn} {newpath arcn stroke} ifelse } bind def /Ds { /y2 exch def /x2 exch def /y1 exch def /x1 exch def /y0 exch def /x0 exch def x0 5 x1 mul add 6 div y0 5 y1 mul add -6 div x2 5 x1 mul add 6 div y2 5 y1 mul add -6 div x1 x2 add 2 div y1 y2 add -2 div inpath {curveto} {newpath x0 x1 add 2 div y0 y1 add -2 div moveto curveto stroke} ifelse } bind def %%EndGlobal /saveobj save def mark 10 PA f 0.1 setlinewidth 3539 1262 3420 1382 Dl 3420 1383 3659 1622 Dl 3660 1622 3780 1502 Dl 3780 1502 3540 1262 Dl 9 CW f (put rect {)2 540 1 1080 1312 t (sw = 0;)2 378 1 1512 1422 t (wd = \(1,1\)/abs\(\(1,1\)\);)2 1188 1 1512 1532 t (ht = 2*wd;)2 540 1 1512 1642 t (};)1080 1752 w 10 PA f (\(The double parentheses are needed in ``)6 1850 1 720 1968 t 10 PI f (abs)2570 1968 w 10 PA f (\( \( 1 , 1 \) \))6 305 1 2707 1968 t 10 S f (\242 \242)1 58 1 3028 1968 t 10 PA f (because ``)1 439 1 3121 1968 t 10 PI f (abs)3560 1968 w 10 PA f ( is parsed as a function)5 1064(\( 1 , 1 \)'')4 279 2 3697 1968 t ( about this example often confuses new users: the vectors)9 2644( point)1 274( One)1 249(with two arguments.\))2 985 4 720 2088 t 10 PI f (wd)4910 2088 w 10 PA f (and)720 2208 w 10 PI f (ht)916 2208 w 10 PA f (point in the)2 515 1 1034 2208 t 10 PI f (same)1576 2208 w 10 PA f ( is in the de\256nition of)5 957(direction. It)1 542 2 1812 2208 t 10 PI f (rect)3339 2208 w 10 PA f (that the)1 341 1 3527 2208 t 10 PI f (ht)3896 2208 w 10 PA f (vector is rotated ninety)3 1033 1 4007 2208 t ( if we give a)4 556( Thus,)1 302(degrees and added to the southern points to arrive at the northern points.)12 3340 3 720 2328 t 10 PI f (ht)4949 2328 w 10 PA f (that is perpendicular to)3 1035 1 720 2448 t 10 PI f (wd)1780 2448 w 10 PA f (, we get a very \257at rectangle.)6 1268 1 1910 2448 t (On the other hand, the de\256nition of)6 1637 1 970 2604 t 10 PI f (rect)2644 2604 w 10 PA f (does not assure that)3 919 1 2841 2604 t 10 PI f (ht)3797 2604 w 10 PA f (and)3925 2604 w 10 PI f (wd)4131 2604 w 10 PA f (will point in the)3 742 1 4298 2604 t ( put statement draws a parallelogram:)5 1686( This)1 240(same direction.)1 675 3 720 2724 t 0.1 setlinewidth 3690 2844 3510 3024 Dl 10 S f (\347)3510 3278 w (\347)3510 3224 w (\347)3510 3124 w 3510 3278 3690 3098 Dl (\347)3690 2944 w (\347)3690 2998 w (\347)3690 3098 w 9 CW f (put rect {)2 540 1 1080 2894 t (ht = 1;)2 378 1 1512 3004 t (wd = \(1,1\)/abs\(\(1,1\)\);)2 1188 1 1512 3114 t (sw = 0;)2 378 1 1512 3224 t (};)1080 3334 w 10 PA f ( feel that a box called)5 990(Some people who)2 812 2 720 3550 t 10 PI f (rect)2559 3550 w 10 PA f (should draw only rectangles are disturbed by this)7 2284 1 2756 3550 t ( remedy is to add another equation to the de\256nition of)10 2410(example. One)1 636 2 720 3670 t 10 PI f (rect)3792 3670 w 10 PA f ( adja-)1 242(, asserting that two)3 846 2 3952 3670 t (cent sides are perpendicular;)3 1324 1 720 3790 t 8 PA f (IDEAL)2082 3790 w 10 PA f ( equation is not satis\256ed \(although it)6 1730(will complain if this)3 936 2 2374 3790 t ( such equation is)3 739( One)1 235(won't stop drawing\).)2 932 3 720 3910 t 9 CW f (wd/abs\(wd\) = ht/abs\(ht\);)2 1296 1 1080 4080 t 10 PA f (Here is a de\256nition for box)5 1242 1 970 4296 t 10 PI f (arrow)2248 4296 w 10 PA f ( symmetrical about its)3 1015(that keeps the head of the arrow)6 1495 2 2530 4296 t (shaft:)720 4416 w 0.1 setlinewidth 3522 4683 3510 4716 Dl 3510 4715 3543 4703 Dl 3510 4716 3690 4536 Dl 9 CW f (arrow {)1 378 1 1080 4586 t (var hd, tl, head, wing;)4 1242 1 1512 4696 t (head = 0.1;)2 594 1 1512 4806 t (wing = head*\(tl-hd\)/abs\(tl-hd\);)2 1674 1 1512 4916 t (conn hd to tl;)3 756 1 1512 5026 t (conn hd + cis\(25\)*wing to hd to hd + cis\(-25\)*wing;)9 2754 1 1512 5136 t (})1080 5246 w 10 PA f (Note the de\256nition of)3 965 1 720 5462 t 10 PI f (wing)1714 5462 w 10 PA f ( a unit vec-)3 501(in the example above: the second part of the expression is)10 2582 2 1957 5462 t ( points from)2 559(tor that)1 336 2 720 5582 t 10 PI f (tl)1648 5582 w 10 PA f (to)1750 5582 w 10 PI f (hd)1871 5582 w 10 PA f (; this is multiplied by)4 967 1 1979 5582 t 10 PI f (head)2979 5582 w 10 PA f (, the length of the ``wings'' on the arrow-)8 1870 1 3170 5582 t (head.)720 5702 w 9 PA f ( parameter section are processed before)5 1583(When a put statement is interpreted, the equations in its)9 2237 2 970 5848 t ( inconsistent equations between the put state-)6 1854( if there are)3 474( Thus,)1 275(the equations in its de\256nition.)4 1217 4 970 5958 t ( can be)2 294( This)1 226( put statement take precedence.)4 1296(ment and the box de\256nition, the equations in the)8 2004 4 970 6068 t ( instance, if the de\256nition of)5 1174( For)1 195(useful to provide default values for variables of a box.)9 2272 3 970 6178 t 9 PI f (rect)4646 6178 w 9 PA f (gave such default values to)4 1083 1 970 6288 t 9 PI f (ht)2076 6288 w 9 PA f (and)2181 6288 w 9 PI f (wd)2356 6288 w 9 PA f ( unless overridden by equations in)5 1383(, they would take effect)4 934 2 2473 6288 t (the parameter section of the put statement.)6 1709 1 970 6398 t 7 PA f (IDEAL)970 6580 w 9 PA f ( avoid)1 251( To)1 153( them.)1 252(ignores inconsistent equations, but it does generate error messages about)9 2921 4 1213 6580 t (this error message about a particular equation, use a tilde \(``)10 2432 1 970 6690 t 9 HB f (\304)3402 6690 w 9 PA f ( in the)2 255(''\) instead of an equals sign)5 1103 2 3432 6690 t ( tilde does)2 424(equation. The)1 575 2 970 6800 t 9 PI f (not)1998 6800 w 9 PA f (give the equation any lower ``priority'' than an equation with an)10 2635 1 2155 6800 t ( the two ordered systems ``)5 1079( So,)1 167( the error message.)3 754(equals sign: all it does is shut off)7 1300 4 970 6910 t 9 PI f (x)4270 6910 w 9 S f (=)4360 6910 w 9 PA f (1,)4455 6910 w 9 PI f (x)4546 6910 w 9 HB f (\304)4628 6910 w 9 PA f (2'')4695 6910 w (and ``)1 239 1 970 7020 t 9 PI f (x)1209 7020 w 9 HB f (\304)1291 7020 w 9 PA f (2,)1358 7020 w 9 PI f (x)1463 7020 w 9 S f (=)1553 7020 w 9 PA f (1'' are)1 256 1 1648 7020 t 9 PI f (different:)1941 7020 w 9 PA f (in the former,)2 574 1 2313 7020 t 9 PI f (x)2924 7020 w 9 PA f ( and no error message)4 943(receives the value 1,)3 841 2 3006 7020 t (appears when the second equation is processed; in the latter,)9 2543 1 970 7130 t 9 PI f (x)3550 7130 w 9 PA f (receives the value 2, and an)5 1159 1 3631 7130 t (error is generated when the second equation is encountered.)8 2406 1 970 7240 t cleartomark showpage saveobj restore %%EndPage: 4 6 %%Page: 5 7 /saveobj save def mark 7 pagesetup 10 PA f (- 5 -)2 166 1 2797 480 t 10 PB f ( Boxes\320Circles and Arcs)3 1134(3.2. Special)1 532 2 720 840 t 10 PA f (Boxes to draw circles and circular arcs are de\256ned in special library \256les.)12 3205 1 970 996 t 10 PB f (3.2.1. Circles)1 590 1 720 1236 t 10 PA f (The box named)2 704 1 970 1392 t 10 PI f (circle)1710 1392 w 10 PA f (has \256ve local variables:)3 1054 1 1970 1392 t 10 PI f (center)3060 1392 w 10 PA f (,)3315 1392 w 10 PI f (radius)3376 1392 w 10 PA f (,)3640 1392 w 10 PI f (z1)3701 1392 w 10 PA f (,)3803 1392 w 10 PI f (z2)3864 1392 w 10 PA f (, and)1 230 1 3966 1392 t 10 PI f (z3)4232 1392 w 10 PA f ( last three)2 453(. The)1 253 2 4334 1392 t ( above, we must give enough information to determine a cir-)10 2722( As)1 174( any points on the circle.)5 1097(may be)1 327 4 720 1512 t ( Here)1 276( is inconsistent.)2 689(cle; giving two points on it is insuf\256cient, and giving three collinear points)12 3355 3 720 1632 t (are three ways to draw a circle of radius one centered at the origin.)13 2952 1 720 1752 t 0.1 setlinewidth 3501 2198 34 34 De 3453 1922 34 34 De 3745 2043 34 34 De (\(z3\))3302 2198 w (\(z2\))3279 1922 w (\(z1\))3787 2043 w 3420 2043 342 342 De 9 CW f (/* giving center and radius */)5 1620 1 1080 1922 t (put circle {)2 648 1 1080 2032 t (center = 0;)2 594 1 1512 2142 t (radius = 1;)2 594 1 1512 2252 t (};)1080 2362 w (/* giving center and a point on the circle */)9 2430 1 1080 2592 t (put circle {)2 648 1 1080 2702 t (center = 0;)2 594 1 1512 2812 t (z1 = 1; /* could also have given z2 or z3 */)11 2376 1 1512 2922 t (};)1080 3032 w (/* giving three points on the circle */)7 2106 1 1080 3262 t (put circle {)2 648 1 1080 3372 t (z1 = \(1,0\);)2 594 1 1512 3482 t (z2 = cis\(135\);)2 756 1 1512 3592 t (z3 = cis\(235\);)2 756 1 1512 3702 t (};)1080 3812 w 10 PA f ( if we ask for)4 585( So,)1 187( are known.)2 531(Once the circle has been determined, all \256ve of its internal variables)11 3017 4 720 4028 t ( the other hand, if)4 795( On)1 189( will be known afterward.)4 1154(a circle giving three points, the radius and center)8 2182 4 720 4148 t (we ask for a circle by giving the center and the radius, the three points)14 3272 1 720 4268 t 10 PI f (z)4029 4268 w 10 PA f (1,)4081 4268 w 10 PI f (z)4193 4268 w 10 PA f (2, and)1 281 1 4245 4268 t 10 PI f (z)4564 4268 w 10 PA f (3, will be)2 424 1 4616 4268 t (known, and will be on the circle, but there is no guarantee where they will be.)15 3435 1 720 4388 t 10 PB f (3.2.2. Arcs)1 480 1 720 4628 t 10 PA f (Box)970 4784 w 10 PI f (arc)1181 4784 w 10 PA f (has eight local variables:)3 1134 1 1356 4784 t 10 PI f (center)2533 4784 w 10 PA f (,)2788 4784 w 10 PI f (radius)2856 4784 w 10 PA f (,)3120 4784 w 10 PI f (start)3188 4784 w 10 PA f (,)3384 4784 w 10 PI f (midway)3452 4784 w 10 PA f (,)3782 4784 w 10 PI f (end)3851 4784 w 10 PA f (,)4004 4784 w 10 PI f (startang)4073 4784 w 10 PA f (,)4419 4784 w 10 PI f (midang)4488 4784 w 10 PA f (, and)1 238 1 4802 4784 t 10 PI f (endang)720 4904 w 10 PA f ( is an arc centered at point)6 1203(. It)1 149 2 1023 4904 t 10 PI f (center)2407 4904 w 10 PA f (with radius)1 517 1 2694 4904 t 10 PI f (radius)3243 4904 w 10 PA f (, starting at point)3 780 1 3507 4904 t 10 PI f (start)4319 4904 w 10 PA f (at an angle)2 494 1 4546 4904 t 10 PI f (startang)720 5024 w 10 PA f (, passing through point)3 1056 1 1066 5024 t 10 PI f (midway)2155 5024 w 10 PA f (at an angle)2 498 1 2518 5024 t 10 PI f (midang)3049 5024 w 10 PA f ( at point)2 386(, and ending)2 570 2 3363 5024 t 10 PI f (end)4353 5024 w 10 PA f (at an angle)2 500 1 4540 5024 t 10 PI f (endang)720 5144 w 10 PA f ( angles are measured with respect to)6 1632(. \(All)1 247 2 1023 5144 t 10 PI f (center)2929 5144 w 10 PA f (, in degrees, with the positive)5 1309 1 3176 5144 t 10 PI f (x)4512 5144 w 10 PA f (-axis taken)1 478 1 4562 5144 t ( that)1 210( Note)1 280(to be zero degrees, and the counterclockwise direction to be positive.\))10 3186 3 720 5264 t 10 PI f (midway)4432 5264 w 10 PA f (is)4791 5264 w 10 PI f (not)4899 5264 w 10 PA f ( neither)1 341( If)1 119( of the arc!)3 470(necessarily the midpoint)2 1094 4 720 5384 t 10 PI f (midway)2771 5384 w 10 PA f (nor)3128 5384 w 10 PI f (midang)3308 5384 w 10 PA f (is given, the arc is drawn coun-)6 1391 1 3649 5384 t (terclockwise from)1 792 1 720 5504 t 10 PI f (start)1537 5504 w 10 PA f (to)1758 5504 w 10 PI f (end)1871 5504 w 10 PA f ( again, a variety of put statements draw the same arc:)10 2356(. Once)1 304 2 2024 5504 t 0.1 setlinewidth 3489 5921 32 32 De 3420 5787 32 32 De 3747 5787 32 32 De (\(end\))3531 5921 w (\(midway\) \(start\))1 1074 1 2978 5787 t 3763 5787 -163 0 -93 134 Da 9 CW f (/* giving center, radius, and)4 1566 1 1080 5674 t (starting and ending angles */)4 1566 1 1242 5784 t (put arc {)2 486 1 1080 5894 t (center = 0;)2 594 1 1512 6004 t (radius = 1;)2 594 1 1512 6114 t (startang = 0;)2 702 1 1512 6224 t (endang = 235;)2 702 1 1512 6334 t (};)1080 6444 w cleartomark showpage saveobj restore %%EndPage: 5 7 %%Page: 6 8 /saveobj save def mark 8 pagesetup 10 PA f (- 6 -)2 166 1 2797 480 t 9 CW f (/* giving center, starting point,)4 1782 1 1080 890 t (and ending angle */)3 1026 1 1242 1000 t (put arc {)2 486 1 1080 1110 t (center = 0;)2 594 1 1512 1220 t (start = 1;)2 540 1 1512 1330 t (endang = 235;)2 702 1 1512 1440 t (};)1080 1550 w 10 PA f 0.1 setlinewidth 3489 2027 32 32 De 3420 1893 32 32 De 3747 1893 32 32 De (\(start\))3531 2027 w (\(midway\) \(end\))1 1043 1 2978 1893 t 3763 1893 -163 0 -93 134 Da 9 CW f (/* giving three points on the arc */)7 1944 1 1080 1780 t (put arc {)2 486 1 1080 1890 t (start = cis\(235\);)2 918 1 1512 2000 t (midway = -1;)2 648 1 1512 2110 t (end = 0;)2 432 1 1512 2220 t (};)1080 2330 w 10 PB f ( Elements of)2 566(3.3. Other)1 466 2 720 2630 t 8 PB f (IDEAL)1777 2630 w 10 PB f (Pictures)2059 2630 w 8 PA f (IDEAL)970 2786 w 10 PA f (pictures also may contain text and splines.)6 1871 1 1244 2786 t 10 PB f ( Captions)1 435(3.3.1. Text)1 475 2 720 3026 t 10 PA f ( The)1 233(There are three commands to place text with respect to a point.)11 2958 2 970 3182 t 10 PI f (left)4202 3182 w 10 PA f (command left-)1 661 1 4379 3182 t ( The)1 230( the text will start there.)5 1115(justi\256es the text with respect to the speci\256ed location:)8 2471 3 720 3302 t 10 PI f (right)4574 3302 w 10 PA f (com-)4820 3302 w ( default is to center the)5 1048( The)1 225(mand right-justi\256es the text so that it ends at the speci\256ed location.)11 3047 3 720 3422 t ( arrows in this picture point to the locations of the named points.\))12 2897( \(The)1 250(text at the point.)3 723 3 720 3542 t 9 CW f (left "some text" at x;)4 1188 1 1080 3712 t ("some centered text" at y;)4 1404 1 1080 3942 t (right "some other text" at z;)5 1566 1 1080 4172 t 10 PA f 0.1 setlinewidth 3946 4366 3908 4352 Dl 3908 4352 3922 4390 Dl 4319 4763 3908 4352 Dl (\(z\))4345 4763 w (some other text)2 683 1 3225 4352 t 2712 4366 2674 4352 Dl 2674 4352 2688 4390 Dl 3085 4763 2674 4352 Dl (\(y\))3110 4763 w (some centered text)2 829 1 2260 4352 t 1478 4366 1440 4352 Dl 1440 4352 1454 4390 Dl 1851 4763 1440 4352 Dl (\(x\))1876 4763 w (some text)1 424 1 1440 4352 t ( you have a line run-)5 958( If)1 126( a string, escape it with a back-slash.)7 1662(To include a double quote mark in)6 1574 4 720 5159 t ( place some text, you may want to add a space to one end of)14 2750(ning through a point at which you)6 1570 2 720 5279 t ( string may include)3 862( The)1 219( chop through the text.)4 1015(the text so that the line doesn't)6 1360 4 720 5399 t 8 PA f (TROFF)4203 5399 w 10 PA f (special char-)1 554 1 4486 5399 t ( commands to other preprocessors \(notably)5 1958(acters \(like \\\(bu\) and)3 965 2 720 5519 t 8 PA f (EQN)3676 5519 w 10 PA f (\), but)1 239 1 3854 5519 t 8 PA f (IDEAL)4126 5519 w 10 PA f (should be run)2 632 1 4408 5519 t (before any other preprocessors.)3 1393 1 720 5639 t 10 PB f (3.3.2. Splines)1 618 1 720 5879 t 8 PA f (IDEAL)970 6035 w 10 PA f (provides quadratic splines that are drawn with a B-spline basis: the user supplies a)13 3786 1 1254 6035 t (sequence of guiding points, and)4 1472 1 720 6155 t 8 PA f (IDEAL)2232 6155 w 10 PA f ( the polygonal)2 665(draws a smooth curve that is tangent to)7 1854 2 2521 6155 t ( spline also starts at the \256rst point and ends)9 1945(path they de\256ne at the midpoint of each segment; the)9 2375 2 720 6275 t (at the last.)2 451 1 720 6395 t 0.1 setlinewidth 3936 6515 48 48 De 3216 6754 48 48 De 3695 6995 48 48 De 3456 6995 48 48 De (\(w\))3985 6515 w (\(z\))3099 6754 w (\(y\) \(x\))1 -291 1 3745 6995 t 3960 6515 3960 6515 3240 6754 Ds 3960 6515 3240 6754 3720 6993 Ds 3240 6754 3720 6993 3481 6993 Ds 3720 6993 3481 6993 3481 6993 Ds 9 CW f (spline x to y to z to w;)7 1296 1 1080 6565 t cleartomark showpage saveobj restore %%EndPage: 6 8 %%Page: 7 9 /saveobj save def mark 9 pagesetup 10 PA f (- 7 -)2 166 1 2797 480 t 10 PB f ( Boxes Together)2 729(4. Putting)1 463 2 720 840 t 10 PA f ( section we present several complete)5 1662(In this)1 288 2 970 996 t 8 PA f (IDEAL)2950 996 w 10 PA f (programs to show how to build up pic-)7 1806 1 3234 996 t (tures from boxes.)2 766 1 720 1116 t 10 PB f ( Instances of Boxes)3 863(4.1. Naming)1 572 2 720 1356 t 10 PA f ( when pictures involve)3 1039( And)1 256(Most pictures involve more than placements of simple boxes.)8 2775 3 970 1512 t ( the)1 177( can refer to)3 566( We)1 212(several boxes, certain geometrical relationships should exist among them.)8 3365 4 720 1632 t ( is a)2 175( Here)1 271(local variables of a box that has been put\320all we need to do is name the put statement.)17 3874 3 720 1752 t ( Pythagoras's Theorem for)3 1216(simple example showing a diagram that could be used to illustrate)10 3104 2 720 1872 t (isoceles triangles:)1 772 1 720 1992 t 0.1 setlinewidth 3959 2351 3720 2112 Dl 3718 2112 3479 2351 Dl 3481 2353 3720 2592 Dl 3721 2590 3960 2351 Dl 10 S1 f (_ ____)1 239 1 3479 2592 t 10 S f (\347)3479 2832 w (\347)3479 2793 w (\347)3479 2693 w 10 S1 f (_ ____)1 239 1 3481 2832 t 10 S f (\347)3720 2692 w (\347)3720 2731 w (\347)3720 2831 w 10 S1 f (_ ____)1 239 1 3240 2351 t 10 S f (\347)3240 2592 w (\347)3240 2553 w (\347)3240 2453 w 10 S1 f (_ ____)1 239 1 3240 2592 t 10 S f (\347)3479 2451 w (\347)3479 2490 w (\347)3479 2590 w 9 CW f (main {)1 324 1 1080 2162 t (put first: rect {)3 918 1 1512 2272 t (sw = 0;)2 378 1 1944 2382 t (ht = wd = 1;)4 648 1 1944 2492 t (};)1512 2602 w (put next: rect {)3 864 1 1512 2712 t (nw = first.se;)2 756 1 1944 2822 t (ht = wd = first.ht;)4 1026 1 1944 2932 t (};)1512 3042 w (put last: rect {)3 864 1 1512 3152 t (sw = first.ne;)2 756 1 1944 3262 t (se = next.ne;)2 702 1 1944 3372 t (ht = wd;)2 432 1 1944 3482 t (};)1512 3592 w (})1080 3702 w 10 PA f ( instance of)2 502(First we place an)3 745 2 720 3918 t 10 PI f (rect)1993 3918 w 10 PA f (called)2179 3918 w 10 PI f (\256rst)2466 3918 w 10 PA f ( we place another)3 782(. Then)1 301 2 2638 3918 t 10 PI f (rect)3747 3918 w 10 PA f (with its upper left corner)4 1107 1 3933 3918 t (\()720 4038 w 10 PI f (ne)753 4038 w 10 PA f (\) at the lower right of)5 964 1 848 4038 t 10 PI f (\256rst)1842 4038 w 10 PA f ( we draw a third square, two of whose adjacent points are)11 2614(. Finally,)1 412 2 2014 4038 t ( could have used any two adjacent)6 1620( We)1 214( \256rst two squares placed.)4 1166(identi\256ed with points on the)4 1320 4 720 4158 t (points on)1 420 1 720 4278 t 10 PI f (last)1169 4278 w 10 PA f (: if we had placed)4 795 1 1321 4278 t 10 PI f (last. ne)1 272 1 2145 4278 t 10 PA f (at)2446 4278 w 10 PI f (\256rst. ne)1 292 1 2558 4278 t 10 PA f (and)2879 4278 w 10 PI f (last. nw)1 305 1 3077 4278 t 10 PA f (at)3411 4278 w 10 PI f (next. ne)1 306 1 3523 4278 t 10 PA f (,)3829 4278 w 8 PA f (IDEAL)3878 4278 w 10 PA f (would have \256gured)2 884 1 4156 4278 t (all the relationships out right, although the program might be quite inscrutable to humans.)13 4011 1 720 4398 t ( name the put statement that produces the)7 2021( we)1 177( If)1 138(How can we circumscribe a triangle?)5 1734 4 970 4554 t (instance, we can just give its three vertices as values for)10 2443 1 720 4674 t 10 PI f (z)3188 4674 w 10 PA f (1,)3240 4674 w 10 PI f (z)3340 4674 w 10 PA f (2, and)1 269 1 3392 4674 t 10 PI f (z)3686 4674 w 10 PA f (3 in an instance of)4 795 1 3738 4674 t 10 PI f (circle)4558 4674 w 10 PA f (.)4782 4674 w 0.1 setlinewidth 3240 5154 720 720 De 10 S1 f (_ ____)1 227 1 3486 5495 t 3714 5495 3941 5040 Dl 3941 5040 3486 5495 Dl 9 CW f (triangle {)1 540 1 1080 4844 t (var z1, z2, z3;)3 810 1 1512 4954 t (conn z1 to z2 to z3 to z1;)7 1404 1 1512 5064 t (})1080 5174 w (main {)1 324 1 1080 5394 t (put T: triangle {)3 918 1 1512 5504 t (z1 = 0;)2 378 1 1944 5614 t (z2 = 1;)2 378 1 1944 5724 t (z3 = \(2,2\);)2 594 1 1944 5834 t (};)1512 5944 w (put circle {)2 648 1 1512 6054 t (z1 = T.z1;)2 540 1 1944 6164 t (z2 = T.z2;)2 540 1 1944 6274 t (z3 = T.z3;)2 540 1 1944 6384 t (};)1512 6494 w (})1080 6604 w cleartomark showpage saveobj restore %%EndPage: 7 9 %%Page: 8 10 /saveobj save def mark 10 pagesetup 10 PA f (- 8 -)2 166 1 2797 480 t 10 PB f ( Section Commands)2 910(4.2. Parameter)1 661 2 720 840 t 10 PA f (Any)970 996 w 8 PA f (IDEAL)1192 996 w 10 PA f ( section)1 340( This)1 246( the parameter section of a put statement.)7 1871(statement may appear in)3 1112 4 1471 996 t (illustrates some uses of this feature.)5 1572 1 720 1116 t ( to draw pictures of a linked list before and after insertion of a new)14 3077(Suppose we will need)3 993 2 970 1272 t ( might start with this de\256nition of a)7 1572(node. We)1 445 2 720 1392 t 10 PI f (listnode)2762 1392 w 10 PA f (:)3087 1392 w 10 S1 f (_ _______)1 360 1 3600 1512 t 10 S f (\347)3600 1872 w (\347)3600 1812 w (\347)3600 1712 w (\347)3600 1612 w 10 S1 f (_ _______)1 360 1 3600 1872 t 10 S f (\347)3960 1612 w (\347)3960 1672 w (\347)3960 1772 w (\347)3960 1872 w 10 S1 f (_ _______)1 360 1 3240 1512 t 10 S f (\347)3240 1872 w (\347)3240 1812 w (\347)3240 1712 w (\347)3240 1612 w 10 S1 f (_ _______)1 360 1 3240 1872 t 10 S f (\347)3600 1612 w (\347)3600 1672 w (\347)3600 1772 w (\347)3600 1872 w 9 CW f (listnode {)1 540 1 1080 1562 t (put info: rect {)3 864 1 1512 1672 t (var hook;)1 486 1 1944 1782 t (hook = \(nw + sw\)/2;)4 1026 1 1944 1892 t (ht = lht;)2 486 1 1944 2002 t (wd = lwd/2;)2 594 1 1944 2112 t (};)1512 2222 w (put next: rect {)3 864 1 1512 2332 t (var c;)1 324 1 1944 2442 t (c = \(nw + se\)/2;)4 864 1 1944 2552 t (sw = info.se;)2 702 1 1944 2662 t (ht = lht;)2 486 1 1944 2772 t (wd = lwd/2;)2 594 1 1944 2882 t (};)1512 2992 w (})1080 3102 w 10 PA f (This version of)2 664 1 720 3318 t 10 PI f (listnode)1413 3318 w 10 PA f (depends on)1 520 1 1767 3318 t 10 PI f (rect)2316 3318 w 10 PA f ( references two variables \()4 1172( that it)2 294(. Notice)1 371 3 2476 3318 t 10 PI f (lwd)4313 3318 w 10 PA f (and)4493 3318 w 10 PI f (lht)4692 3318 w 10 PA f (\) that)1 237 1 4803 3318 t ( variables must be de\256ned in any environment in which)9 2486(are not local to itself: these)5 1187 2 720 3438 t 10 PI f (listnode)4420 3438 w 10 PA f (is put.)1 276 1 4764 3438 t ( have added statements that de\256ne new variables \()8 2263( We)1 201( to it.\))2 264(\(They are global)2 722 4 720 3558 t 10 PI f (hook)4170 3558 w 10 PA f (in)4380 3558 w 10 PI f (\256rst)4495 3558 w 10 PA f (and)4687 3558 w 10 PI f (c)4884 3558 w 10 PA f (in)4953 3558 w 10 PI f (next)720 3678 w 10 PA f (\) that are local to the particular instance of)8 1864 1 898 3678 t 10 PI f (rect)2787 3678 w 10 PA f (.)2947 3678 w (Now we draw the list as it is before insertion:)9 2004 1 970 3834 t 0.1 setlinewidth 3048 4073 3085 4056 Dl 3085 4056 3048 4039 Dl 10 S1 f (_ ____)1 205 1 2880 4056 t 10 PA f (list)2722 4056 w 3460 4485 3497 4468 Dl 3496 4467 3459 4450 Dl 10 S1 f (_ ____)1 205 1 3291 4468 t 10 PA f (new)3077 4468 w 3871 4073 3908 4056 Dl 3908 4056 3871 4039 Dl 10 S1 f (_ __________)1 514 1 3394 4056 t (_ ____)1 205 1 3702 4365 t 10 S f (\347)3702 4571 w (\347)3702 4566 w (\347)3702 4466 w 10 S1 f (_ ____)1 205 1 3703 4571 t 10 S f (\347)3908 4465 w (\347)3908 4470 w (\347)3908 4570 w 10 S1 f (_ ____)1 205 1 3497 4365 t 10 S f (\347)3497 4571 w (\347)3497 4566 w (\347)3497 4466 w 10 S1 f (_ ____)1 205 1 3497 4571 t 10 S f (\347)3702 4465 w (\347)3702 4470 w (\347)3702 4570 w 10 S1 f (_ ____)1 205 1 4114 3954 t 10 S f (\347)4114 4159 w (\347)4114 4154 w (\347)4114 4054 w 10 S1 f (_ ____)1 205 1 4115 4159 t 10 S f (\347)4320 4054 w (\347)4320 4059 w (\347)4320 4159 w 10 S1 f (_ ____)1 205 1 3908 3954 t 10 S f (\347)3908 4159 w (\347)3908 4154 w (\347)3908 4054 w 10 S1 f (_ ____)1 205 1 3909 4159 t 10 S f (\347)4114 4054 w (\347)4114 4059 w (\347)4114 4159 w 4115 4159 4320 3954 Dl 10 S1 f (_ ____)1 205 1 3291 3954 t 10 S f (\347)3291 4159 w (\347)3291 4154 w (\347)3291 4054 w 10 S1 f (_ ____)1 205 1 3292 4159 t 10 S f (\347)3497 4054 w (\347)3497 4059 w (\347)3497 4159 w 10 S1 f (_ ____)1 205 1 3085 3954 t 10 S f (\347)3085 4159 w (\347)3085 4154 w (\347)3085 4054 w 10 S1 f (_ ____)1 205 1 3086 4159 t 10 S f (\347)3291 4054 w (\347)3291 4059 w (\347)3291 4159 w 9 CW f (main {)1 324 1 1080 4004 t (var lht, lwd;)2 702 1 1512 4114 t (lht = 1;)2 432 1 1512 4224 t (lwd = 2*lht;)2 648 1 1512 4334 t (put first: listnode {)3 1134 1 1512 4444 t (info.sw = 0;)2 648 1 1944 4554 t (};)1512 4664 w (put last: listnode {)3 1080 1 1512 4774 t (info.sw = 2[first.info.sw,first.next.se];)2 2214 1 1944 4884 t (conn next.sw to next.ne;)3 1296 1 1944 4994 t (};)1512 5104 w (put new: listnode {)3 1026 1 1512 5214 t (info.nw = 2[first.next.ne,first.next.se];)2 2214 1 1944 5324 t (};)1512 5434 w (put arrow {)2 594 1 1512 5544 t (hd = last.info.hook;)2 1080 1 1944 5654 t (tl = first.next.c;)2 972 1 1944 5764 t (};)1512 5874 w (put arrow {)2 594 1 1512 5984 t (hd = new.info.hook;)2 1026 1 1944 6094 t (tl = hd - 1;)4 648 1 1944 6204 t (right "new " at tl;)4 1026 1 1944 6314 t (};)1512 6424 w (put arrow {)2 594 1 1512 6534 t (hd = first.info.hook;)2 1134 1 1944 6644 t (tl = hd - 1;)4 648 1 1944 6754 t (right "list " at tl;)4 1080 1 1944 6864 t (};)1512 6974 w (})1080 7084 w 10 PA f ( of the calls to)4 645(Here we have added statements directly to the parameter section of two)11 3273 2 720 7300 t 10 PI f (arrow)4672 7300 w 10 PA f (to)4952 7300 w cleartomark showpage saveobj restore %%EndPage: 8 10 %%Page: 9 11 /saveobj save def mark 11 pagesetup 10 PA f (- 9 -)2 166 1 2797 480 t (avoid either naming each instance of)5 1646 1 720 840 t 10 PI f (arrow)2396 840 w 10 PA f ( could)1 278(or naming the tails of these arrows so that text)9 2090 2 2672 840 t ( have also added a statement to draw the null pointer in box)12 2661( We)1 198(be placed there.)2 697 3 720 960 t 10 PI f (last)4301 960 w 10 PA f (.)4453 960 w ( unchanged:)1 555(The program to draw the list after insertion of the new node remains largely)13 3515 2 970 1116 t (the nodes haven't moved; only the arrows hooking them together have moved.)11 3499 1 720 1236 t 0.1 setlinewidth 3048 1475 3085 1458 Dl 3085 1458 3048 1441 Dl 10 S1 f (_ ____)1 205 1 2880 1458 t 10 PA f (list)2722 1458 w 3460 1887 3497 1870 Dl 3496 1869 3459 1852 Dl 10 S1 f (_ ____)1 205 1 3291 1870 t 10 PA f (new)3077 1870 w 3912 1601 3908 1561 Dl 3908 1562 3880 1591 Dl 3907 1562 3805 1870 Dl 3469 1738 3497 1767 Dl 3497 1766 3501 1726 Dl 3496 1766 3394 1458 Dl 10 S1 f (_ ____)1 205 1 3702 1767 t 10 S f (\347)3702 1973 w (\347)3702 1968 w (\347)3702 1868 w 10 S1 f (_ ____)1 205 1 3703 1973 t 10 S f (\347)3908 1867 w (\347)3908 1872 w (\347)3908 1972 w 10 S1 f (_ ____)1 205 1 3497 1767 t 10 S f (\347)3497 1973 w (\347)3497 1968 w (\347)3497 1868 w 10 S1 f (_ ____)1 205 1 3497 1973 t 10 S f (\347)3702 1867 w (\347)3702 1872 w (\347)3702 1972 w 10 S1 f (_ ____)1 205 1 4114 1356 t 10 S f (\347)4114 1561 w (\347)4114 1556 w (\347)4114 1456 w 10 S1 f (_ ____)1 205 1 4115 1561 t 10 S f (\347)4320 1456 w (\347)4320 1461 w (\347)4320 1561 w 10 S1 f (_ ____)1 205 1 3908 1356 t 10 S f (\347)3908 1561 w (\347)3908 1556 w (\347)3908 1456 w 10 S1 f (_ ____)1 205 1 3909 1561 t 10 S f (\347)4114 1456 w (\347)4114 1461 w (\347)4114 1561 w 4115 1561 4320 1356 Dl 10 S1 f (_ ____)1 205 1 3291 1356 t 10 S f (\347)3291 1561 w (\347)3291 1556 w (\347)3291 1456 w 10 S1 f (_ ____)1 205 1 3292 1561 t 10 S f (\347)3497 1456 w (\347)3497 1461 w (\347)3497 1561 w 10 S1 f (_ ____)1 205 1 3085 1356 t 10 S f (\347)3085 1561 w (\347)3085 1556 w (\347)3085 1456 w 10 S1 f (_ ____)1 205 1 3086 1561 t 10 S f (\347)3291 1456 w (\347)3291 1461 w (\347)3291 1561 w 9 CW f (main {)1 324 1 1080 1406 t (var lht, lwd;)2 702 1 1512 1516 t (lht = 1;)2 432 1 1512 1626 t (lwd = 2*lht;)2 648 1 1512 1736 t (put first: listnode {)3 1134 1 1512 1846 t (info.sw = 0;)2 648 1 1944 1956 t (};)1512 2066 w (put last: listnode {)3 1080 1 1512 2176 t (info.sw = 2[first.info.sw,first.next.se];)2 2214 1 1944 2286 t (conn next.sw to next.ne;)3 1296 1 1944 2396 t (};)1512 2506 w (put new: listnode {)3 1026 1 1512 2616 t (info.nw = 2[first.next.ne,first.next.se];)2 2214 1 1944 2726 t (};)1512 2836 w (/* These two arrows are different: */)6 1998 1 1512 2946 t (put arrow {)2 594 1 1512 3056 t (hd = new.info.nw;)2 918 1 1944 3166 t (tl = first.next.c;)2 972 1 1944 3276 t (};)1512 3386 w (put arrow {)2 594 1 1512 3496 t (hd = last.info.sw;)2 972 1 1944 3606 t (tl = new.next.c;)2 864 1 1944 3716 t (})1512 3826 w (/* These are the same as before: */)7 1890 1 1512 3936 t (put arrow {)2 594 1 1512 4046 t (hd = new.info.hook;)2 1026 1 1944 4156 t (tl = hd - 1;)4 648 1 1944 4266 t (right "new " at tl;)4 1026 1 1944 4376 t (};)1512 4486 w (put arrow {)2 594 1 1512 4596 t (hd = first.info.hook;)2 1134 1 1944 4706 t (tl = hd - 1;)4 648 1 1944 4816 t (right "list " at tl;)4 1080 1 1944 4926 t (};)1512 5036 w (})1080 5146 w 10 PB f ( Shorter Version)2 750(4.3. A)1 278 2 720 5446 t 10 PA f ( somewhat long-winded because it demonstrates many features of)8 2977(The previous example is)3 1093 2 970 5602 t 8 PA f (IDEAL)720 5722 w 10 PA f ( instance, it would probably have made better sense to de\256ne)10 2725( For)1 203( needed.)1 376(that really aren't)2 739 4 997 5722 t 10 PI f (listnode)720 5842 w 10 PA f ( rather than building it out of)6 1365(as a basic element)3 822 2 1081 5842 t 10 PI f (rect)3305 5842 w 10 PA f ( would reduce the need for)5 1256(s. This)1 319 2 3465 5842 t ( \(e.g.)1 213(delving deep into the internals of boxes from outside)8 2355 2 720 5962 t 10 PI f (\256rst.info.hook)3339 5962 w 10 PA f ( is the same exam-)4 813(\). Here)1 328 2 3899 5962 t (ple reworked:)1 618 1 720 6082 t 0.1 setlinewidth 3048 6321 3085 6304 Dl 3085 6304 3048 6287 Dl 10 S1 f (_ ____)1 205 1 2880 6304 t 10 PA f (list)2722 6304 w 3460 6733 3497 6716 Dl 3496 6715 3459 6698 Dl 10 S1 f (_ ____)1 205 1 3291 6716 t 10 PA f (new)3077 6716 w 3912 6447 3908 6407 Dl 3908 6408 3880 6437 Dl 3907 6408 3805 6716 Dl 3469 6584 3497 6613 Dl 3497 6612 3501 6572 Dl 3496 6612 3394 6304 Dl 10 S f (\347)3702 6819 w (\347)3702 6814 w (\347)3702 6714 w 10 S1 f (_ ________)1 411 1 3497 6613 t 10 S f (\347)3908 6819 w (\347)3908 6814 w (\347)3908 6714 w 10 S1 f (_ ________)1 411 1 3497 6819 t 10 S f (\347)3497 6713 w (\347)3497 6718 w (\347)3497 6818 w (\347)4114 6407 w (\347)4114 6402 w (\347)4114 6302 w 10 S1 f (_ ________)1 411 1 3909 6202 t 10 S f (\347)4320 6407 w (\347)4320 6402 w (\347)4320 6302 w 10 S1 f (_ ________)1 411 1 3908 6407 t 10 S f (\347)3908 6302 w (\347)3908 6307 w (\347)3908 6407 w 4115 6407 4320 6202 Dl (\347)3291 6407 w (\347)3291 6402 w (\347)3291 6302 w 10 S1 f (_ ________)1 411 1 3086 6202 t 10 S f (\347)3497 6407 w (\347)3497 6402 w (\347)3497 6302 w 10 S1 f (_ ________)1 411 1 3085 6407 t 10 S f (\347)3085 6302 w (\347)3085 6307 w (\347)3085 6407 w cleartomark showpage saveobj restore %%EndPage: 9 11 %%Page: 10 12 /saveobj save def mark 12 pagesetup 10 PA f (- 10 -)2 216 1 2772 480 t 9 CW f (listnode {)1 540 1 1080 890 t (var n, s, e, w, ne, nw, se, sw, next;)9 1998 1 1512 1000 t (n = s + \(0,1\)*lht;)4 972 1 1512 1110 t (ne = n + 0.5*lwd = nw + lwd;)8 1512 1 1512 1220 t (se = s + 0.5*lwd = sw + lwd;)8 1512 1 1512 1330 t (e = \(ne + se\)/2;)4 864 1 1512 1440 t (w = \(nw + sw\)/2;)4 864 1 1512 1550 t (next = \(ne + s\)/2;)4 972 1 1512 1660 t (conn nw to ne to se to sw to nw;)9 1728 1 1512 1770 t (conn n to s;)3 648 1 1512 1880 t (})1080 1990 w (main {)1 324 1 1080 2210 t (var lht, lwd;)2 702 1 1512 2320 t (lht = 1;)2 432 1 1512 2430 t (lwd = 2;)2 432 1 1512 2540 t (put first: listnode {)3 1134 1 1512 2650 t (sw = 0;)2 378 1 1944 2760 t (};)1512 2870 w (put last: listnode {)3 1080 1 1512 2980 t (sw = 2[first.sw,first.se];)2 1404 1 1944 3090 t (conn s to ne;)3 702 1 1944 3200 t (};)1512 3310 w (put new: listnode {)3 1026 1 1512 3420 t (nw = 2[first.ne,first.se];)2 1404 1 1944 3530 t (};)1512 3640 w (put arrow {)2 594 1 1512 3750 t (hd = new.nw;)2 648 1 1944 3860 t (tl = first.next;)2 864 1 1944 3970 t (};)1512 4080 w (put arrow {)2 594 1 1512 4190 t (hd = last.sw;)2 702 1 1944 4300 t (tl = new.next;)2 756 1 1944 4410 t (};)1512 4520 w (put arrow {)2 594 1 1512 4630 t (hd = new.w;)2 594 1 1944 4740 t (tl = hd - 1;)4 648 1 1944 4850 t (right "new " at tl;)4 1026 1 1944 4960 t (};)1512 5070 w (put arrow {)2 594 1 1512 5180 t (hd = first.w;)2 702 1 1944 5290 t (tl = hd - 1;)4 648 1 1944 5400 t (right "list " at tl;)4 1080 1 1944 5510 t (};)1512 5620 w (})1080 5730 w 10 PA f ( side and a right side: they may include several)9 2256(Notice that equations need not be just a left)8 2064 2 720 5910 t (expressions that should be equal.)4 1466 1 720 6030 t 10 PB f ( of)1 120(5. Iteration)1 519 2 720 6270 t 8 PB f (IDEAL)1384 6270 w 10 PB f (Constructs)1666 6270 w (5.1. Pens)1 416 1 720 6510 t 10 PA f (In Donald Knuth's)2 884 1 970 6666 t 8 PA f (METAFONT)1909 6666 w 10 PA f ( ellipses, and)2 633(system, pens are different shapes\320circles,)4 1984 2 2423 6666 t (polygons\320that draw along curves.)3 1578 1 720 6786 t 8 PA f (IDEAL)2344 6786 w 10 PA f (includes pens as a generalization of this idea:)7 2034 1 2624 6786 t 10 PI f (any)4689 6786 w 10 PA f (box)4878 6786 w ( A)1 131( instance, users may de\256ne ``dashed'' or ``dotted'' pens.)8 2476( For)1 204( along a line.)3 571(may be used to draw)4 938 5 720 6906 t (pen statement looks like this:)4 1285 1 720 7026 t cleartomark showpage saveobj restore %%EndPage: 10 12 %%Page: 11 13 /saveobj save def mark 13 pagesetup 10 PA f (- 11 -)2 216 1 2772 480 t 9 CW f (conn)1080 890 w 9 PI f (x)1350 890 w 9 CW f (to)1449 890 w 9 PI f (y)1611 890 w 9 CW f (using)1512 1000 w 9 PI f (n pen)1 234 1 1836 1000 t 9 CW f ({)2124 1000 w (...)1944 1110 w (} <)1 162 1 1512 1220 t 9 PI f (a)1674 1220 w 9 CW f (,)1714 1220 w 9 PI f (b)1768 1220 w 9 CW f (>;)1809 1220 w 10 PA f ( in this statement are)4 964(\(The only keywords)2 909 2 720 1400 t 10 PI f (conn)2629 1400 w 10 PA f (,)2826 1400 w 10 PI f (to)2887 1400 w 10 PA f (, and)1 230 1 2964 1400 t 10 PI f (using)3230 1400 w 10 PA f (.\))3459 1400 w 10 PI f (Pen)3578 1400 w 10 PA f (may be any box.)3 756 1 3778 1400 t 8 PA f (IDEAL)4585 1400 w 10 PA f (will)4870 1400 w (place)720 1520 w 10 PI f (n)986 1520 w 10 PA f (copies of)1 401 1 1077 1520 t 10 PI f (pen)1513 1520 w 10 PA f (in the space from)3 791 1 1701 1520 t 10 PI f (x)2527 1520 w 10 PA f (to)2612 1520 w 10 PI f (y)2735 1520 w 10 PA f (.)2785 1520 w 10 PI f (a)2870 1520 w 10 PA f (and)2949 1520 w 10 PI f (b)3153 1520 w 10 PA f (are expressions known to)3 1157 1 3234 1520 t 10 PI f (pen)4426 1520 w 10 PA f ( \256rst)1 210(. The)1 251 2 4579 1520 t (instance of)1 487 1 720 1640 t 10 PI f (pen)1244 1640 w 10 PA f (will have)1 419 1 1434 1640 t 10 PI f (a)1890 1640 w 10 PA f (at)1971 1640 w 10 PI f (x)2091 1640 w 10 PA f (, and the last instance of)5 1122 1 2141 1640 t 10 PI f (pen)3300 1640 w 10 PA f (will have)1 420 1 3491 1640 t 10 PI f (b)3949 1640 w 10 PA f (at)4033 1640 w 10 PI f (y)4154 1640 w 10 PA f (; every instance in)3 836 1 4204 1640 t (between will have its)3 958 1 720 1760 t 10 PI f (a)1710 1760 w 10 PA f (at the preceding one's)3 993 1 1786 1760 t 10 PI f (b)2811 1760 w 10 PA f (, and its)2 362 1 2857 1760 t 10 PI f (b)3251 1760 w 10 PA f (at the succeeding one's)3 1039 1 3329 1760 t 10 PI f (a)4400 1760 w 10 PA f (, as shown in)3 596 1 4444 1760 t (this picture:)1 526 1 720 1880 t 10 PI f (b a)1 -220 1 4249 2180 t 10 S1 f (_ _______)1 360 1 3960 2000 t 10 S f (\347)3960 2360 w (\347)3960 2300 w (\347)3960 2200 w (\347)3960 2100 w 10 S1 f (_ _______)1 360 1 3960 2360 t 10 S f (\347)4320 2100 w (\347)4320 2160 w (\347)4320 2260 w (\347)4320 2360 w 10 PI f (y)4345 2180 w (n)4112 2324 w 10 PA f (...)3743 2180 w 10 PI f (b a)1 -220 1 3529 2180 t 10 S1 f (_ _______)1 360 1 3240 2000 t 10 S f (\347)3240 2360 w (\347)3240 2300 w (\347)3240 2200 w (\347)3240 2100 w 10 S1 f (_ _______)1 360 1 3240 2360 t 10 S f (\347)3600 2100 w (\347)3600 2160 w (\347)3600 2260 w (\347)3600 2360 w 10 PI f (i)3351 2324 w 10 PA f (+1)3379 2324 w 10 PI f (b a)1 -220 1 3169 2180 t 10 S1 f (_ _______)1 360 1 2880 2000 t 10 S f (\347)2880 2360 w (\347)2880 2300 w (\347)2880 2200 w (\347)2880 2100 w 10 S1 f (_ _______)1 360 1 2880 2360 t 10 S f (\347)3240 2100 w (\347)3240 2160 w (\347)3240 2260 w (\347)3240 2360 w 10 PI f (i)3046 2324 w (b a)1 -220 1 2809 2180 t 10 S1 f (_ _______)1 360 1 2520 2000 t 10 S f (\347)2520 2360 w (\347)2520 2300 w (\347)2520 2200 w (\347)2520 2100 w 10 S1 f (_ _______)1 360 1 2520 2360 t 10 S f (\347)2880 2100 w (\347)2880 2160 w (\347)2880 2260 w (\347)2880 2360 w 10 PI f (i)2636 2324 w 10 PA f (\2611)2664 2324 w (...)2303 2180 w 10 PI f (b a)1 -220 1 2089 2180 t 10 S1 f (_ _______)1 360 1 1800 2000 t 10 S f (\347)1800 2360 w (\347)1800 2300 w (\347)1800 2200 w (\347)1800 2100 w 10 S1 f (_ _______)1 360 1 1800 2360 t 10 S f (\347)2160 2100 w (\347)2160 2160 w (\347)2160 2260 w (\347)2160 2360 w 10 PA f (2)1955 2324 w 10 PI f (b a)1 -220 1 1729 2180 t 10 S1 f (_ _______)1 360 1 1440 2000 t 10 S f (\347)1440 2360 w (\347)1440 2300 w (\347)1440 2200 w (\347)1440 2100 w 10 S1 f (_ _______)1 360 1 1440 2360 t 10 S f (\347)1800 2100 w (\347)1800 2160 w (\347)1800 2260 w (\347)1800 2360 w 10 PA f (1)1595 2324 w 10 PI f (x)1365 2180 w 10 PA f (Here is an example box that contains an angular wavy path:)10 2650 1 970 2756 t 0.1 setlinewidth 3600 3020 3780 3164 Dl 3780 3164 4140 2876 Dl 4140 2876 4320 3020 Dl (\(end\) \(start\))1 -770 1 4345 3020 t 9 CW f (wavy {)1 324 1 1080 3574 t (var start, end, perp, pt1, pt2, ht;)6 1890 1 1512 3684 t (perp = \(0,1\)*\(start - end\)/abs\(start - end\);)6 2376 1 1512 3794 t (pt1 = 0.25[start,end] + perp*ht;)4 1728 1 1512 3904 t (pt2 = 0.75[start,end] - perp*ht;)4 1728 1 1512 4014 t (conn start to pt1 to pt2 to end;)7 1728 1 1512 4124 t (})1080 4234 w 10 PA f (Here we use)2 550 1 720 4450 t 10 PI f (wavy)1295 4450 w 10 PA f (as a pen to indicate that part of a rectangle is missing.)11 2364 1 1544 4450 t 0.1 setlinewidth 4061 4858 4087 4889 Dl 4086 4889 4005 4898 Dl 4006 4899 4032 4930 Dl 4089 4786 4115 4817 Dl 4115 4817 4034 4826 Dl 4034 4827 4060 4858 Dl 4118 4714 4144 4745 Dl 4144 4745 4063 4754 Dl 4063 4755 4089 4786 Dl 4147 4642 4173 4673 Dl 4173 4673 4092 4682 Dl 4092 4683 4118 4714 Dl 4176 4570 4202 4601 Dl 4201 4601 4120 4610 Dl 4121 4611 4147 4642 Dl 4176 4570 4320 4570 Dl 10 S f (\347)4320 4930 w (\347)4320 4870 w (\347)4320 4770 w (\347)4320 4670 w 10 S1 f (_ _____)1 288 1 4032 4930 t 3917 4858 3943 4889 Dl 3942 4889 3861 4898 Dl 3862 4899 3888 4930 Dl 3945 4786 3971 4817 Dl 3971 4817 3890 4826 Dl 3890 4827 3916 4858 Dl 3974 4714 4000 4745 Dl 4000 4745 3919 4754 Dl 3919 4755 3945 4786 Dl 4003 4642 4029 4673 Dl 4029 4673 3948 4682 Dl 3948 4683 3974 4714 Dl 4032 4570 4058 4601 Dl 4057 4601 3976 4610 Dl 3977 4611 4003 4642 Dl (_ ________)1 432 1 3600 4570 t 10 S f (\347)3600 4930 w (\347)3600 4870 w (\347)3600 4770 w (\347)3600 4670 w 10 S1 f (_ _____)1 288 1 3600 4930 t 9 CW f (main {)1 324 1 1080 4620 t (var ne, nw, se, sw;)4 1026 1 1512 4730 t (var n1, s1, n2, s2;)4 1026 1 1512 4840 t (ne = nw + 2;)4 648 1 1512 4950 t (se = sw + 2;)4 648 1 1512 5060 t (ne = se + \(0,1\);)4 864 1 1512 5170 t (n2 - 0.4 = n1 = 0.6[nw,ne];)6 1458 1 1512 5280 t (s2 - 0.4 = s1 = 0.4[sw,se];)6 1458 1 1512 5390 t (conn n1 to nw to sw to s1;)7 1404 1 1512 5500 t (conn n1 to s1)3 702 1 1512 5610 t (using int\(5*abs\(n1-s1\)\) wavy {)3 1620 1 1944 5720 t (ht = -0.1;)2 540 1 2376 5830 t (} ;)1 756 1 1944 5940 t (conn n2 to ne to se to s2;)7 1404 1 1512 6050 t (conn n2 to s2)3 702 1 1512 6160 t (using int\(5*abs\(n2-s2\)\) wavy {)3 1620 1 1944 6270 t (ht = -0.1;)2 540 1 2376 6380 t (} ;)1 756 1 1944 6490 t (})1080 6600 w 10 PA f (We can change)2 674 1 720 6816 t 10 PI f (wavy)1424 6816 w 10 PA f ( the word)2 440(to contain a smooth wave by changing)6 1733 2 1678 6816 t 10 PI f (conn)3882 6816 w 10 PA f (in the \256fth line of its)5 922 1 4118 6816 t (de\256nition to)1 545 1 720 6936 t 10 PI f (spline)1290 6936 w 10 PA f (, and use the same instructions above to draw the picture with the new pen.)14 3345 1 1538 6936 t cleartomark showpage saveobj restore %%EndPage: 11 13 %%Page: 12 14 /saveobj save def mark 14 pagesetup 10 PA f (- 12 -)2 216 1 2772 480 t 0.1 setlinewidth 4032 1200 4032 1200 4006 1169 Ds 4032 1200 4006 1169 4087 1160 Ds 4006 1169 4087 1160 4061 1129 Ds 4087 1160 4061 1129 4061 1129 Ds 4060 1128 4060 1128 4034 1097 Ds 4060 1128 4034 1097 4115 1088 Ds 4034 1097 4115 1088 4089 1057 Ds 4115 1088 4089 1057 4089 1057 Ds 4089 1056 4089 1056 4063 1025 Ds 4089 1056 4063 1025 4144 1016 Ds 4063 1025 4144 1016 4118 985 Ds 4144 1016 4118 985 4118 985 Ds 4118 984 4118 984 4092 953 Ds 4118 984 4092 953 4173 944 Ds 4092 953 4173 944 4147 913 Ds 4173 944 4147 913 4147 913 Ds 4147 912 4147 912 4121 881 Ds 4147 912 4121 881 4202 872 Ds 4121 881 4202 872 4176 841 Ds 4202 872 4176 841 4176 841 Ds 4176 840 4320 840 Dl 10 S f (\347)4320 1200 w (\347)4320 1140 w (\347)4320 1040 w (\347)4320 940 w 10 S1 f (_ _____)1 288 1 4032 1200 t 3888 1200 3888 1200 3862 1169 Ds 3888 1200 3862 1169 3943 1160 Ds 3862 1169 3943 1160 3917 1129 Ds 3943 1160 3917 1129 3917 1129 Ds 3916 1128 3916 1128 3890 1097 Ds 3916 1128 3890 1097 3971 1088 Ds 3890 1097 3971 1088 3945 1057 Ds 3971 1088 3945 1057 3945 1057 Ds 3945 1056 3945 1056 3919 1025 Ds 3945 1056 3919 1025 4000 1016 Ds 3919 1025 4000 1016 3974 985 Ds 4000 1016 3974 985 3974 985 Ds 3974 984 3974 984 3948 953 Ds 3974 984 3948 953 4029 944 Ds 3948 953 4029 944 4003 913 Ds 4029 944 4003 913 4003 913 Ds 4003 912 4003 912 3977 881 Ds 4003 912 3977 881 4058 872 Ds 3977 881 4058 872 4032 841 Ds 4058 872 4032 841 4032 841 Ds (_ ________)1 432 1 3600 840 t 10 S f (\347)3600 1200 w (\347)3600 1140 w (\347)3600 1040 w (\347)3600 940 w 10 S1 f (_ _____)1 288 1 3600 1200 t 10 PB f ( as For-Statements)2 832(5.2. Pens)1 416 2 720 1680 t 10 PA f (The pen statement)2 816 1 970 1836 t 9 CW f (conn)1080 2006 w 9 PI f (x)1350 2006 w 9 CW f (to)1449 2006 w 9 PI f (y)1611 2006 w 9 CW f (using)1512 2116 w 9 PI f (n pen)1 234 1 1836 2116 t 9 CW f ({)2124 2116 w (...)1944 2226 w (} <)1 162 1 1512 2336 t 9 PI f (a)1674 2336 w 9 CW f (,)1714 2336 w 9 PI f (b)1768 2336 w 9 CW f (>;)1809 2336 w 10 PA f (has the same effect as)4 948 1 720 2552 t 9 CW f (for)1080 2722 w 9 PI f (i)1296 2722 w 9 CW f (= 1 to)2 324 1 1375 2722 t 9 PI f (n)1753 2722 w 9 CW f ({)1857 2722 w (put)1512 2832 w 9 PI f (pen)1728 2832 w 9 CW f ({)1912 2832 w 9 PI f (a)1944 2942 w 9 CW f (= \(\()1 216 1 2038 2942 t 9 PI f (i)2254 2942 w 9 CW f (-1\)/)2279 2942 w 9 PI f (n)2495 2942 w 9 CW f (\)[)2545 2942 w 9 PI f (x)2653 2942 w 9 CW f (,)2698 2942 w 9 PI f (y)2752 2942 w 9 CW f (];)2797 2942 w 9 PI f (b)1944 3052 w 9 CW f (= \()1 162 1 2039 3052 t 9 PI f (i)2201 3052 w 9 CW f (/)2226 3052 w 9 PI f (n)2280 3052 w 9 CW f (\)[)2330 3052 w 9 PI f (x)2438 3052 w 9 CW f (,)2483 3052 w 9 PI f (y)2537 3052 w 9 CW f (];)2582 3052 w (...)1944 3162 w (};)1512 3272 w (})1080 3382 w 10 PA f (imagining for a moment that)4 1275 1 720 3598 t 8 PA f (IDEAL)2020 3598 w 10 PA f (had for-statements.)1 855 1 2294 3598 t 9 PA f ( an)1 134(This means a pen statement can be used to synthesize a for-statement in)12 3020 2 970 3744 t 7 PA f (IDEAL)4161 3744 w 9 PA f (program.)4417 3744 w (Here is a pen statement to draw a dashed arc:)9 1820 1 970 3854 t 0.1 setlinewidth 3863 4214 344 111 -357 -56 Da 3914 4113 293 212 -322 -164 Da 3994 4033 212 293 -256 -256 Da 4095 3981 111 344 -164 -322 Da 4207 3964 0 362 -56 -357 Da 4319 3981 -111 344 56 -357 Da 4420 4033 -212 293 164 -322 Da 4500 4113 -293 212 256 -256 Da 4552 4214 -344 111 322 -164 Da 4570 4326 -362 0 357 -56 Da 8 CW f (conn 0 to 180)3 624 1 1330 4014 t (using 10 arc {)3 672 1 1714 4114 t (center = 0;)2 528 1 2098 4214 t (radius = 1;)2 528 1 2098 4314 t (};)1 1056 1 1714 4414 t 9 PA f (To draw a set of concentric circles we can say:)9 1828 1 970 4656 t 0.1 setlinewidth 3850 5126 720 720 De 3922 5126 576 576 De 3994 5126 432 432 De 4066 5126 288 288 De 4138 5126 144 144 De 8 CW f (main {)1 288 1 1330 4816 t (conn 1 to 6)3 528 1 1714 4916 t (using 5 circle {)3 768 1 2098 5016 t (center = 0;)2 528 1 2482 5116 t (} ;)1 960 1 2482 5216 t (})1330 5316 w 9 PA f ( means that each)3 696(In the \256rst example, the second expression in angle brackets is important: it)12 3124 2 970 5668 t ( expression is redundant: its only pur-)6 1538( the second example, this)4 1017( In)1 133(``dash'' covers nine degrees.)3 1132 4 970 5778 t (pose is to prevent)3 730 1 970 5888 t 7 PA f (IDEAL)1731 5888 w 9 PA f (from generating a stream of error messages about inconsistent equa-)9 2809 1 1981 5888 t ( simulating for-statements is necessary only because pens are)8 2595( contorted way of)3 768(tions. This)1 457 3 970 5998 t ( thing at each end of and all along a path that is being drawn with some)16 2955(meant to do the right)4 865 2 970 6108 t (box, and not as general iteration constructs.)6 1739 1 970 6218 t (Why doesn't)1 524 1 970 6400 t 7 PA f (IDEAL)1533 6400 w 9 PA f ( that every variable in an)5 1075( Notice)1 327(have for-statements?)1 844 3 1791 6400 t 7 PA f (IDEAL)4077 6400 w 9 PA f (program is)1 454 1 4336 6400 t ( exception to)2 519( the index of a for-statement must be an)8 1624( Obviously)1 466(assigned a value exactly once.)4 1211 4 970 6510 t ( to have two kinds of variables\320)6 1367( the index internally prevents the need)6 1584( Generating)1 499(that rule.)1 370 4 970 6620 t ( boxes placed by pen statements cannot be referenced)8 2135( local variables of)3 698( The)1 197(changing and \256xed.)2 790 4 970 6730 t ( general)1 325( A)1 123( the boxes are not named when they are placed.)9 1960(outside the pen statement, because)4 1412 4 970 6840 t ( instances of)2 498(for-statement could lead to the need to generate automatically names for different)11 3322 2 970 6950 t (boxes, a hard problem that I don't understand well enough yet.)10 2529 1 970 7060 t cleartomark showpage saveobj restore %%EndPage: 12 14 %%Page: 13 15 /saveobj save def mark 15 pagesetup 10 PA f (- 13 -)2 216 1 2772 480 t 10 PB f ( Regions)1 397(5.3. Filling)1 505 2 720 840 t 10 PA f ( can have not only dashed)5 1158( \(We)1 232( as a pen, we can shade regions.)7 1410(Because any box can be used)5 1270 4 970 996 t ( box)1 187( Take)1 265(and dotted ink, but checkered paint!\))5 1639 3 720 1116 t 10 PI f (wavy)2836 1116 w 10 PA f ( we construct a box)4 852( First)1 250(, for instance.)2 590 3 3060 1116 t 10 PI f (brush)4777 1116 w 10 PA f (,)5015 1116 w (which consists of seven copies of)5 1448 1 720 1236 t 10 PI f (wavy)2193 1236 w 10 PA f (going horizontally:)1 846 1 2442 1236 t 0.1 setlinewidth 4217 1387 4242 1417 Dl 4243 1417 4294 1356 Dl 4295 1356 4320 1386 Dl 4115 1387 4140 1417 Dl 4140 1417 4191 1356 Dl 4192 1356 4217 1386 Dl 4012 1387 4037 1417 Dl 4037 1417 4088 1356 Dl 4089 1356 4114 1386 Dl 3909 1387 3934 1417 Dl 3934 1417 3985 1356 Dl 3986 1356 4011 1386 Dl 3806 1387 3831 1417 Dl 3831 1417 3882 1356 Dl 3883 1356 3908 1386 Dl 3703 1387 3728 1417 Dl 3729 1417 3780 1356 Dl 3780 1356 3805 1386 Dl 3600 1387 3625 1417 Dl 3626 1417 3677 1356 Dl 3677 1356 3702 1386 Dl 9 CW f (brush {)1 378 1 1080 1406 t (var top, bot;)2 702 1 1512 1516 t (var bwd, bht;)2 702 1 1512 1626 t (var leftpt, rightpt;)2 1080 1 1512 1736 t (leftpt = 0.5*\(top+bot\) - bwd/2;)4 1674 1 1512 1846 t (rightpt = 0.5*\(top+bot\) + bwd/2;)4 1728 1 1512 1956 t (conn leftpt to rightpt)3 1188 1 1512 2066 t (using 7 wavy {)3 756 1 1944 2176 t (ht = bht;)2 486 1 2376 2286 t (};)1944 2396 w (})1080 2506 w 10 PA f (Then we use ``brush'' to draw vertically over the region of interest.)11 2952 1 720 2686 t 0.1 setlinewidth 4217 3441 4242 3477 Dl 4243 3477 4294 3405 Dl 4295 3405 4320 3441 Dl 4115 3441 4140 3477 Dl 4140 3477 4191 3405 Dl 4192 3405 4217 3441 Dl 4012 3441 4037 3477 Dl 4037 3477 4088 3405 Dl 4089 3405 4114 3441 Dl 3909 3441 3934 3477 Dl 3934 3477 3985 3405 Dl 3986 3405 4011 3441 Dl 3806 3441 3831 3477 Dl 3831 3477 3882 3405 Dl 3883 3405 3908 3441 Dl 3703 3441 3728 3477 Dl 3729 3477 3780 3405 Dl 3780 3405 3805 3441 Dl 3600 3441 3625 3477 Dl 3626 3477 3677 3405 Dl 3677 3405 3702 3441 Dl 4217 3322 4242 3358 Dl 4243 3357 4294 3285 Dl 4295 3285 4320 3321 Dl 4115 3322 4140 3358 Dl 4140 3357 4191 3285 Dl 4192 3285 4217 3321 Dl 4012 3322 4037 3358 Dl 4037 3357 4088 3285 Dl 4089 3285 4114 3321 Dl 3909 3322 3934 3358 Dl 3934 3357 3985 3285 Dl 3986 3285 4011 3321 Dl 3806 3322 3831 3358 Dl 3831 3357 3882 3285 Dl 3883 3285 3908 3321 Dl 3703 3322 3728 3358 Dl 3729 3357 3780 3285 Dl 3780 3285 3805 3321 Dl 3600 3322 3625 3358 Dl 3626 3357 3677 3285 Dl 3677 3285 3702 3321 Dl 4217 3202 4242 3238 Dl 4243 3238 4294 3166 Dl 4295 3166 4320 3202 Dl 4115 3202 4140 3238 Dl 4140 3238 4191 3166 Dl 4192 3166 4217 3202 Dl 4012 3202 4037 3238 Dl 4037 3238 4088 3166 Dl 4089 3166 4114 3202 Dl 3909 3202 3934 3238 Dl 3934 3238 3985 3166 Dl 3986 3166 4011 3202 Dl 3806 3202 3831 3238 Dl 3831 3238 3882 3166 Dl 3883 3166 3908 3202 Dl 3703 3202 3728 3238 Dl 3729 3238 3780 3166 Dl 3780 3166 3805 3202 Dl 3600 3202 3625 3238 Dl 3626 3238 3677 3166 Dl 3677 3166 3702 3202 Dl 4217 3081 4242 3117 Dl 4243 3117 4294 3045 Dl 4295 3045 4320 3081 Dl 4115 3081 4140 3117 Dl 4140 3117 4191 3045 Dl 4192 3045 4217 3081 Dl 4012 3081 4037 3117 Dl 4037 3117 4088 3045 Dl 4089 3045 4114 3081 Dl 3909 3081 3934 3117 Dl 3934 3117 3985 3045 Dl 3986 3045 4011 3081 Dl 3806 3081 3831 3117 Dl 3831 3117 3882 3045 Dl 3883 3045 3908 3081 Dl 3703 3081 3728 3117 Dl 3729 3117 3780 3045 Dl 3780 3045 3805 3081 Dl 3600 3081 3625 3117 Dl 3626 3117 3677 3045 Dl 3677 3045 3702 3081 Dl 4217 2961 4242 2997 Dl 4243 2997 4294 2925 Dl 4295 2925 4320 2961 Dl 4115 2961 4140 2997 Dl 4140 2997 4191 2925 Dl 4192 2925 4217 2961 Dl 4012 2961 4037 2997 Dl 4037 2997 4088 2925 Dl 4089 2925 4114 2961 Dl 3909 2961 3934 2997 Dl 3934 2997 3985 2925 Dl 3986 2925 4011 2961 Dl 3806 2961 3831 2997 Dl 3831 2997 3882 2925 Dl 3883 2925 3908 2961 Dl 3703 2961 3728 2997 Dl 3729 2997 3780 2925 Dl 3780 2925 3805 2961 Dl 3600 2961 3625 2997 Dl 3626 2997 3677 2925 Dl 3677 2925 3702 2961 Dl 4217 2842 4242 2878 Dl 4243 2878 4294 2806 Dl 4295 2806 4320 2842 Dl 4115 2842 4140 2878 Dl 4140 2878 4191 2806 Dl 4192 2806 4217 2842 Dl 4012 2842 4037 2878 Dl 4037 2878 4088 2806 Dl 4089 2806 4114 2842 Dl 3909 2842 3934 2878 Dl 3934 2878 3985 2806 Dl 3986 2806 4011 2842 Dl 3806 2842 3831 2878 Dl 3831 2878 3882 2806 Dl 3883 2806 3908 2842 Dl 3703 2842 3728 2878 Dl 3729 2878 3780 2806 Dl 3780 2806 3805 2842 Dl 3600 2842 3625 2878 Dl 3626 2878 3677 2806 Dl 3677 2806 3702 2842 Dl 9 CW f (conn \(0,1\) to \(0,-1\))3 1080 1 1080 2856 t (using 6 brush {)3 810 1 1512 2966 t (bwd = 2;)2 432 1 1944 3076 t (bht = 0.1;)2 540 1 1944 3186 t (};)1944 3296 w 10 PB f ( Boxes)1 292(6. Opaque)1 491 2 720 4036 t 8 PA f (IDEAL)970 4192 w 10 PA f ( this section we will sometimes)5 1400( In)1 148( picture.)1 370(includes statements to blot out pieces of a)7 1873 4 1249 4192 t ( that we)2 371( such cases, assume)3 887( In)1 151(place opaque boxes without explicitly drawing any background.)7 2911 4 720 4312 t (have painted over the area with pens as above.)8 2069 1 720 4432 t 10 PB f ( Polygons)1 448(6.1. Opaque)1 566 2 720 4672 t 8 PA f (IDEAL)970 4828 w 10 PA f ( The)1 228( area it covers.)3 668(needs to know the vertices of a polygon in order to opaque the)12 2890 3 1254 4828 t (vertices are speci\256ed as a list in a)7 1514 1 720 4948 t 10 PI f (bdlist)2267 4948 w 10 PA f ( to opaque a rectangular region)5 1421( instance,)1 420(statement. For)1 667 3 2532 4948 t (using the)1 409 1 720 5068 t 10 PI f (rect)1154 5068 w 10 PA f (box de\256ned in Section 3, we could use the following statement:)10 2785 1 1339 5068 t 10 S1 f (_ _______)1 360 1 3816 5316 t 10 S f (\347)3816 5676 w (\347)3816 5616 w (\347)3816 5516 w (\347)3816 5416 w 10 S1 f (_ _______)1 360 1 3816 5676 t 10 S f (\347)4176 5416 w (\347)4176 5476 w (\347)4176 5576 w (\347)4176 5676 w 0.1 setlinewidth 4217 5841 4242 5877 Dl 4243 5877 4294 5805 Dl 4295 5805 4320 5841 Dl 4115 5841 4140 5877 Dl 4140 5877 4191 5805 Dl 4192 5805 4217 5841 Dl 4012 5841 4037 5877 Dl 4037 5877 4088 5805 Dl 4089 5805 4114 5841 Dl 3909 5841 3934 5877 Dl 3934 5877 3985 5805 Dl 3986 5805 4011 5841 Dl 3806 5841 3831 5877 Dl 3831 5877 3882 5805 Dl 3883 5805 3908 5841 Dl 3703 5841 3728 5877 Dl 3729 5877 3780 5805 Dl 3780 5805 3805 5841 Dl 3600 5841 3625 5877 Dl 3626 5877 3677 5805 Dl 3677 5805 3702 5841 Dl 4217 5738 4242 5774 Dl 4243 5774 4294 5702 Dl 4295 5702 4320 5738 Dl 4115 5738 4140 5774 Dl 4140 5774 4191 5702 Dl 4192 5702 4217 5738 Dl 4012 5738 4037 5774 Dl 4037 5774 4088 5702 Dl 4089 5702 4114 5738 Dl 3909 5738 3934 5774 Dl 3934 5774 3985 5702 Dl 3986 5702 4011 5738 Dl 3806 5738 3831 5774 Dl 3831 5774 3882 5702 Dl 3883 5702 3908 5738 Dl 3703 5738 3728 5774 Dl 3729 5774 3780 5702 Dl 3780 5702 3805 5738 Dl 3600 5738 3625 5774 Dl 3626 5774 3677 5702 Dl 3677 5702 3702 5738 Dl 4217 5635 4242 5671 Dl 4243 5671 4294 5599 Dl 4295 5599 4320 5635 Dl 4176 5620 4191 5599 Dl 4192 5599 4217 5635 Dl 3806 5635 3816 5649 Dl 3703 5635 3728 5671 Dl 3729 5671 3780 5599 Dl 3780 5599 3805 5635 Dl 3600 5635 3625 5671 Dl 3626 5671 3677 5599 Dl 3677 5599 3702 5635 Dl 4217 5532 4242 5568 Dl 4243 5568 4294 5496 Dl 4295 5496 4320 5532 Dl 4176 5517 4191 5496 Dl 4192 5496 4217 5532 Dl 3806 5532 3816 5546 Dl 3703 5532 3728 5568 Dl 3729 5568 3780 5496 Dl 3780 5496 3805 5532 Dl 3600 5532 3625 5568 Dl 3626 5568 3677 5496 Dl 3677 5496 3702 5532 Dl 4217 5429 4242 5465 Dl 4243 5465 4294 5393 Dl 4295 5393 4320 5429 Dl 4176 5414 4191 5393 Dl 4192 5393 4217 5429 Dl 3806 5430 3816 5444 Dl 3703 5429 3728 5465 Dl 3729 5465 3780 5393 Dl 3780 5393 3805 5429 Dl 3600 5429 3625 5465 Dl 3626 5465 3677 5393 Dl 3677 5393 3702 5429 Dl 4217 5326 4242 5362 Dl 4243 5362 4294 5290 Dl 4295 5290 4320 5326 Dl 4173 5315 4191 5290 Dl 4192 5290 4217 5326 Dl 4070 5315 4088 5290 Dl 4088 5291 4106 5316 Dl 3967 5315 3985 5290 Dl 3986 5291 4004 5316 Dl 3806 5327 3816 5341 Dl 3864 5315 3882 5290 Dl 3883 5291 3901 5316 Dl 3703 5326 3728 5362 Dl 3729 5362 3780 5290 Dl 3780 5290 3805 5326 Dl 3600 5326 3625 5362 Dl 3626 5362 3677 5290 Dl 3677 5290 3702 5326 Dl 4217 5224 4242 5260 Dl 4243 5260 4294 5188 Dl 4295 5188 4320 5224 Dl 4115 5224 4140 5260 Dl 4140 5260 4191 5188 Dl 4192 5188 4217 5224 Dl 4012 5224 4037 5260 Dl 4037 5260 4088 5188 Dl 4089 5188 4114 5224 Dl 3909 5224 3934 5260 Dl 3934 5260 3985 5188 Dl 3986 5188 4011 5224 Dl 3806 5224 3831 5260 Dl 3831 5260 3882 5188 Dl 3883 5188 3908 5224 Dl 3703 5224 3728 5260 Dl 3729 5260 3780 5188 Dl 3780 5188 3805 5224 Dl 3600 5224 3625 5260 Dl 3626 5260 3677 5188 Dl 3677 5188 3702 5224 Dl 9 CW f (put rect {)2 540 1 1080 5238 t (opaque;)1512 5348 w (bdlist = sw, se, ne, nw;)5 1296 1 1512 5458 t (sw = \(-0.4,-0.4\);)2 918 1 1512 5568 t (wd = ht = 1;)4 648 1 1512 5678 t (};)1080 5788 w 10 PA f (The sides of the rectangle are drawn by)7 1773 1 720 6444 t 10 PI f (rect)2523 6444 w 10 PA f ( not supplied automatically by the opaque-)6 1939(: they are)2 418 2 2683 6444 t ( we wanted to save only the interior of the rectangle, we could use almost the same)16 3685( If)1 118(ing routine.)1 517 3 720 6564 t (statement:)720 6684 w cleartomark showpage saveobj restore %%EndPage: 13 15 %%Page: 14 16 /saveobj save def mark 16 pagesetup 10 PA f (- 14 -)2 216 1 2772 480 t 10 S1 f (_ _______)1 360 1 3816 984 t 10 S f (\347)3816 1344 w (\347)3816 1284 w (\347)3816 1184 w (\347)3816 1084 w 10 S1 f (_ _______)1 360 1 3816 1344 t 10 S f (\347)4176 1084 w (\347)4176 1144 w (\347)4176 1244 w (\347)4176 1344 w 0.1 setlinewidth 4115 1302 4140 1338 Dl 4140 1338 4176 1288 Dl 4012 1302 4037 1338 Dl 4037 1338 4088 1266 Dl 4089 1266 4114 1302 Dl 3909 1302 3934 1338 Dl 3934 1338 3985 1266 Dl 3986 1266 4011 1302 Dl 3816 1317 3831 1338 Dl 3831 1338 3882 1266 Dl 3883 1266 3908 1302 Dl 4115 1200 4140 1236 Dl 4140 1235 4176 1185 Dl 4012 1200 4037 1236 Dl 4037 1236 4088 1164 Dl 4089 1164 4114 1200 Dl 3909 1200 3934 1236 Dl 3934 1236 3985 1164 Dl 3986 1164 4011 1200 Dl 3816 1215 3831 1236 Dl 3831 1236 3882 1164 Dl 3883 1164 3908 1200 Dl 4115 1097 4140 1133 Dl 4140 1132 4176 1082 Dl 4012 1097 4037 1133 Dl 4037 1133 4088 1061 Dl 4089 1061 4114 1097 Dl 3909 1097 3934 1133 Dl 3934 1133 3985 1061 Dl 3986 1061 4011 1097 Dl 3816 1112 3831 1133 Dl 3831 1133 3882 1061 Dl 3883 1061 3908 1097 Dl 4115 994 4140 1030 Dl 4140 1030 4173 984 Dl 4012 994 4037 1030 Dl 4037 1030 4070 984 Dl 4107 984 4114 994 Dl 3909 994 3934 1030 Dl 3934 1030 3967 984 Dl 4004 984 4011 994 Dl 3816 1009 3831 1030 Dl 3831 1030 3864 984 Dl 3901 984 3908 994 Dl 9 CW f (put rect {)2 540 1 1080 890 t (opaque exterior;)1 864 1 1512 1000 t (bdlist = sw, se, ne, nw;)5 1296 1 1512 1110 t (sw = \(-0.4,-0.4\);)2 918 1 1512 1220 t (wd = ht = 1;)4 648 1 1512 1330 t (};)1080 1440 w 10 PA f ( of rectangles, we should include a)6 1562(If we plan to opaque a lot)6 1159 2 970 1656 t 10 PI f (bdlist)3722 1656 w 10 PA f (in the de\256nition of)3 839 1 3985 1656 t 10 PI f (rect)4855 1656 w 10 PA f (.)5015 1656 w (Such a default)2 669 1 720 1776 t 10 PI f (bdlist)1434 1776 w 10 PA f ( the put statement)3 857(would be referenced only if the parameter section of)8 2472 2 1711 1776 t (included an opaque statement)3 1335 1 720 1896 t 10 PI f (and)2080 1896 w 10 PA f (did not include its own)4 1026 1 2263 1896 t 10 PI f (bdlist)3314 1896 w 10 PA f (.)3546 1896 w 10 PB f ( Circular Arc Polygons)3 1030(6.2. Opaque)1 566 2 720 2136 t 10 PA f (The edges of opaque regions can also be circular arcs.)9 2360 1 970 2292 t 9 PA f ( addition to)2 485(This generalization of the simple boundary statement is the most recent)10 2943 2 970 2438 t 7 PA f (IDEAL)4431 2438 w 9 PA f (. It)1 140 1 4650 2438 t ( circles and their sectors and segments as special cases, and makes opaqueing)12 3209(avoids treating)1 611 2 970 2548 t (circular arc polygons much easier.)4 1365 1 970 2658 t 10 PA f ( arc edge, one gives its endpoints and a point through which it passes; this)14 3407(To specify a circular)3 913 2 720 2850 t ( list by the symbol ``)5 894(``pass-through'' point is marked in the boundary)6 2171 2 720 2970 t 10 HB f (\303)3785 2970 w 10 PA f ( example, the bound-)3 939(''. For)1 283 2 3818 2970 t (ary list for the sector shown below is)7 1620 1 720 3090 t 0.1 setlinewidth 4223 3554 3600 3914 Dl 3600 3914 3960 3291 Dl 4223 3554 -623 360 360 -623 Da 4217 3863 4242 3899 Dl 4243 3899 4294 3827 Dl 4295 3827 4320 3863 Dl 4115 3863 4140 3899 Dl 4140 3899 4191 3827 Dl 4192 3827 4217 3863 Dl 4012 3863 4037 3899 Dl 4037 3899 4088 3827 Dl 4089 3827 4114 3863 Dl 3909 3863 3934 3899 Dl 3934 3899 3985 3827 Dl 3986 3827 4011 3863 Dl 3806 3863 3831 3899 Dl 3831 3899 3882 3827 Dl 3883 3827 3908 3863 Dl 3703 3863 3728 3899 Dl 3729 3899 3780 3827 Dl 3780 3827 3805 3863 Dl 3600 3864 3616 3886 Dl 3698 3858 3702 3863 Dl 4217 3760 4242 3796 Dl 4243 3796 4294 3724 Dl 4295 3724 4320 3760 Dl 4115 3760 4140 3796 Dl 4140 3796 4191 3724 Dl 4192 3724 4217 3760 Dl 4012 3760 4037 3796 Dl 4037 3796 4088 3724 Dl 4089 3724 4114 3760 Dl 3909 3760 3934 3796 Dl 3934 3796 3985 3724 Dl 3986 3724 4011 3760 Dl 3824 3786 3831 3796 Dl 3832 3796 3850 3770 Dl 3896 3744 3908 3760 Dl 3600 3760 3625 3796 Dl 3626 3796 3677 3724 Dl 3677 3724 3695 3749 Dl 4217 3657 4242 3693 Dl 4243 3693 4294 3621 Dl 4295 3621 4320 3657 Dl 4115 3657 4140 3693 Dl 4140 3693 4191 3621 Dl 4192 3621 4217 3657 Dl 4022 3671 4037 3693 Dl 4038 3693 4075 3640 Dl 4094 3629 4114 3657 Dl 3703 3657 3728 3692 Dl 3600 3657 3625 3693 Dl 3626 3693 3677 3621 Dl 3677 3621 3702 3657 Dl 4219 3557 4242 3590 Dl 4243 3590 4294 3518 Dl 4295 3518 4320 3554 Dl 3805 3555 3806 3556 Dl 3703 3554 3728 3590 Dl 3729 3590 3780 3518 Dl 3780 3518 3805 3554 Dl 3600 3554 3625 3590 Dl 3626 3590 3677 3518 Dl 3677 3518 3702 3554 Dl 4217 3451 4242 3487 Dl 4243 3487 4294 3415 Dl 4295 3415 4320 3451 Dl 4159 3460 4191 3415 Dl 4192 3415 4217 3451 Dl 3806 3451 3831 3487 Dl 3831 3487 3882 3415 Dl 3883 3416 3885 3419 Dl 3703 3451 3728 3487 Dl 3729 3487 3780 3415 Dl 3780 3415 3805 3451 Dl 3600 3451 3625 3487 Dl 3626 3487 3677 3415 Dl 3677 3415 3702 3451 Dl 4217 3348 4242 3384 Dl 4243 3384 4294 3312 Dl 4295 3312 4320 3348 Dl 4115 3348 4140 3384 Dl 4140 3384 4191 3312 Dl 4192 3312 4217 3348 Dl 4056 3356 4088 3312 Dl 4089 3312 4114 3348 Dl 3909 3349 3918 3362 Dl 3806 3348 3831 3384 Dl 3831 3384 3882 3312 Dl 3883 3312 3908 3348 Dl 3703 3348 3728 3384 Dl 3729 3384 3780 3312 Dl 3780 3312 3805 3348 Dl 3600 3348 3625 3384 Dl 3626 3384 3677 3312 Dl 3677 3312 3702 3348 Dl 4217 3246 4242 3282 Dl 4243 3282 4294 3210 Dl 4295 3210 4320 3246 Dl 4115 3246 4140 3282 Dl 4140 3282 4191 3210 Dl 4192 3210 4217 3246 Dl 4012 3246 4037 3282 Dl 4037 3282 4088 3210 Dl 4089 3210 4114 3246 Dl 3909 3246 3934 3282 Dl 3934 3282 3985 3210 Dl 3986 3210 4011 3246 Dl 3806 3246 3831 3282 Dl 3831 3282 3882 3210 Dl 3883 3210 3908 3246 Dl 3703 3246 3728 3282 Dl 3729 3282 3780 3210 Dl 3780 3210 3805 3246 Dl 3600 3246 3625 3282 Dl 3626 3282 3677 3210 Dl 3677 3210 3702 3246 Dl 9 CW f (boundary = center, cis\(30\), \303 cis\(45\), cis\(60\);)6 2538 1 1080 3260 t 10 PA f (Another common opaque arc is the segment:)6 1979 1 970 4026 t 0.1 setlinewidth 4320 4866 3600 4146 Dl 4320 4866 -720 0 0 -720 Da 4217 4814 4242 4850 Dl 4243 4850 4268 4814 Dl 4318 4812 4320 4814 Dl 4115 4814 4140 4850 Dl 4140 4850 4191 4778 Dl 4192 4778 4217 4814 Dl 4012 4814 4037 4850 Dl 4037 4850 4088 4778 Dl 4089 4778 4114 4814 Dl 3909 4814 3934 4850 Dl 3934 4850 3985 4778 Dl 3986 4778 4011 4814 Dl 3806 4814 3831 4850 Dl 3831 4850 3882 4778 Dl 3883 4778 3908 4814 Dl 3703 4814 3728 4850 Dl 3729 4850 3780 4778 Dl 3780 4778 3805 4814 Dl 3600 4814 3625 4850 Dl 3626 4850 3677 4778 Dl 3677 4778 3702 4814 Dl 4295 4676 4320 4711 Dl 4115 4711 4140 4747 Dl 4140 4747 4165 4711 Dl 4012 4711 4037 4747 Dl 4037 4747 4088 4675 Dl 4089 4675 4114 4711 Dl 3909 4711 3934 4747 Dl 3934 4747 3985 4675 Dl 3986 4675 4011 4711 Dl 3806 4711 3831 4747 Dl 3831 4747 3882 4675 Dl 3883 4675 3908 4711 Dl 3703 4711 3728 4747 Dl 3729 4747 3780 4675 Dl 3780 4675 3805 4711 Dl 3600 4711 3625 4747 Dl 3626 4747 3677 4675 Dl 3677 4675 3702 4711 Dl 4271 4604 4294 4572 Dl 4295 4572 4320 4608 Dl 4012 4608 4037 4644 Dl 4037 4644 4062 4608 Dl 3909 4608 3934 4644 Dl 3934 4644 3985 4572 Dl 3986 4572 4011 4608 Dl 3806 4608 3831 4644 Dl 3831 4644 3882 4572 Dl 3883 4572 3908 4608 Dl 3703 4608 3728 4644 Dl 3729 4644 3780 4572 Dl 3780 4572 3805 4608 Dl 3600 4608 3625 4644 Dl 3626 4644 3677 4572 Dl 3677 4572 3702 4608 Dl 4243 4541 4294 4470 Dl 4295 4470 4320 4506 Dl 3909 4506 3934 4542 Dl 3935 4542 3960 4506 Dl 3806 4506 3831 4542 Dl 3831 4542 3882 4470 Dl 3883 4470 3908 4506 Dl 3703 4506 3728 4542 Dl 3729 4542 3780 4470 Dl 3780 4470 3805 4506 Dl 3600 4506 3625 4542 Dl 3626 4542 3677 4470 Dl 3677 4470 3702 4506 Dl 4217 4403 4242 4439 Dl 4243 4439 4294 4367 Dl 4295 4367 4320 4403 Dl 4159 4412 4191 4367 Dl 4192 4367 4217 4403 Dl 3806 4403 3831 4439 Dl 3832 4439 3857 4403 Dl 3703 4403 3728 4439 Dl 3729 4439 3780 4367 Dl 3780 4367 3805 4403 Dl 3600 4403 3625 4439 Dl 3626 4439 3677 4367 Dl 3677 4367 3702 4403 Dl 4217 4300 4242 4336 Dl 4243 4336 4294 4264 Dl 4295 4264 4320 4300 Dl 4115 4300 4140 4336 Dl 4140 4336 4191 4264 Dl 4192 4264 4217 4300 Dl 4056 4308 4088 4264 Dl 4089 4264 4114 4300 Dl 3703 4300 3728 4336 Dl 3729 4336 3754 4300 Dl 3600 4300 3625 4336 Dl 3626 4336 3677 4264 Dl 3677 4264 3702 4300 Dl 4217 4197 4242 4233 Dl 4243 4233 4294 4161 Dl 4295 4161 4320 4197 Dl 4115 4197 4140 4233 Dl 4140 4233 4191 4161 Dl 4192 4161 4217 4197 Dl 4012 4197 4037 4233 Dl 4037 4233 4088 4161 Dl 4089 4161 4114 4197 Dl 3909 4198 3928 4225 Dl 3937 4229 3985 4161 Dl 3986 4161 4011 4197 Dl 3859 4193 3882 4161 Dl 3883 4161 3908 4197 Dl 3776 4167 3780 4161 Dl 3780 4161 3786 4170 Dl 3600 4197 3625 4233 Dl 3626 4233 3651 4197 Dl 9 CW f (boundary = cis\(0\), \303 cis\(45\), cis\(90\);)5 2052 1 1080 4196 t 10 PA f (One can construct an opaque circle out of two semicircular edges:)10 2897 1 970 5512 t 0.1 setlinewidth 3600 5992 720 720 De 4140 5992 -180 0 180 0 Da 4115 6300 4123 6312 Dl 4186 6271 4191 6264 Dl 4191 6265 4192 6266 Dl 4012 6300 4037 6336 Dl 4037 6336 4088 6264 Dl 4089 6264 4114 6300 Dl 3909 6300 3934 6336 Dl 3934 6336 3985 6264 Dl 3986 6264 4011 6300 Dl 3806 6300 3823 6324 Dl 3836 6329 3882 6264 Dl 3883 6264 3908 6300 Dl 3761 6291 3780 6264 Dl 3780 6264 3805 6300 Dl 4217 6198 4235 6223 Dl 4115 6197 4140 6233 Dl 4140 6233 4191 6161 Dl 4192 6161 4217 6197 Dl 4012 6197 4037 6233 Dl 4037 6233 4088 6161 Dl 4089 6161 4114 6197 Dl 3909 6197 3934 6233 Dl 3935 6232 3979 6170 Dl 3991 6169 4011 6197 Dl 3806 6197 3831 6233 Dl 3831 6233 3882 6161 Dl 3883 6161 3908 6197 Dl 3703 6197 3728 6233 Dl 3729 6233 3780 6161 Dl 3780 6161 3805 6197 Dl 3659 6187 3677 6161 Dl 3677 6161 3702 6197 Dl 4217 6094 4242 6130 Dl 4243 6130 4294 6058 Dl 4295 6059 4309 6079 Dl 4115 6094 4140 6130 Dl 4140 6130 4191 6058 Dl 4192 6058 4217 6094 Dl 4111 6090 4114 6094 Dl 3806 6094 3831 6130 Dl 3831 6130 3836 6123 Dl 3703 6094 3728 6130 Dl 3729 6130 3780 6058 Dl 3780 6058 3805 6094 Dl 3627 6128 3677 6058 Dl 3677 6058 3702 6094 Dl 4217 5992 4242 6028 Dl 4243 6028 4294 5956 Dl 4295 5956 4320 5992 Dl 4138 6024 4140 6028 Dl 4140 6028 4191 5956 Dl 4192 5956 4217 5992 Dl 3703 5992 3728 6028 Dl 3729 6028 3780 5956 Dl 3780 5956 3782 5960 Dl 3600 5992 3625 6028 Dl 3626 6028 3677 5956 Dl 3677 5956 3702 5992 Dl 4217 5889 4242 5925 Dl 4242 5925 4292 5855 Dl 4115 5889 4140 5925 Dl 4140 5925 4191 5853 Dl 4192 5853 4217 5889 Dl 4083 5860 4088 5853 Dl 4089 5853 4114 5889 Dl 3806 5889 3809 5893 Dl 3703 5889 3728 5925 Dl 3729 5925 3780 5853 Dl 3780 5853 3805 5889 Dl 3611 5905 3625 5925 Dl 3626 5925 3677 5853 Dl 3677 5853 3702 5889 Dl 4217 5786 4242 5822 Dl 4243 5821 4261 5795 Dl 4115 5786 4140 5822 Dl 4140 5822 4191 5750 Dl 4192 5750 4217 5786 Dl 4012 5786 4037 5822 Dl 4037 5822 4088 5750 Dl 4089 5750 4114 5786 Dl 3908 5786 3928 5814 Dl 3941 5812 3985 5750 Dl 3986 5750 4011 5786 Dl 3806 5786 3831 5822 Dl 3831 5822 3882 5750 Dl 3883 5750 3908 5786 Dl 3703 5786 3728 5822 Dl 3729 5822 3780 5750 Dl 3780 5750 3805 5786 Dl 3684 5761 3702 5786 Dl 4115 5683 4140 5719 Dl 4140 5719 4159 5692 Dl 4012 5683 4037 5719 Dl 4037 5718 4083 5653 Dl 4097 5659 4114 5683 Dl 3909 5683 3934 5719 Dl 3934 5719 3985 5647 Dl 3986 5647 4011 5683 Dl 3806 5683 3831 5719 Dl 3831 5719 3882 5647 Dl 3883 5647 3908 5683 Dl 3727 5718 3728 5719 Dl 3729 5718 3734 5711 Dl 3797 5671 3805 5683 Dl 9 CW f (boundary = cis\(0\), \303 cis\(90\), cis\(180\), \303 cis\(270\);)7 2754 1 1080 5682 t 10 PA f (Here, the outer circle has an opaque exterior, while the inner circle has an opaque interior.)15 3982 1 720 6558 t 10 PB f ( is Important)2 588(6.3. Order)1 472 2 720 6798 t 10 PA f ( when)1 276( But)1 208( the order in which boxes are put does not matter.)10 2244(Without the ability to opaque,)4 1342 4 970 6954 t ( order obviously)2 737(some boxes are opaque,)3 1064 2 720 7074 t 10 PI f (does)2549 7074 w 10 PA f ( statements are executed in the order in)7 1760(matter. Put)1 523 2 2757 7074 t ( opaque box is drawn, the opaquing is done)8 2023( an)1 143( When)1 324(which they appear in the box de\256nition.)6 1830 4 720 7194 t 10 PI f (\256rst)720 7314 w 10 PA f (, then the lines of the box are drawn; so, for instance, an opaque)13 2849 1 892 7314 t 10 PI f (listnode)3769 7314 w 10 PA f (does include the line)3 919 1 4121 7314 t cleartomark showpage saveobj restore %%EndPage: 14 16 %%Page: 15 17 /saveobj save def mark 17 pagesetup 10 PA f (- 15 -)2 216 1 2772 480 t (down its middle separating its)4 1347 1 720 840 t 10 PI f (info)2092 840 w 10 PA f (\256eld from its)2 569 1 2281 840 t 10 PI f (next)2875 840 w 10 PA f (\256eld.)3086 840 w 10 PB f ( Hard Facts)2 510(6.4. Some)1 456 2 720 1080 t 10 PA f ( splines can be used to opaque objects, nor will they be clipped properly if)14 3352(Neither text nor)2 718 2 970 1236 t (they are in a picture and an opaque box is placed over them.)12 2666 1 720 1356 t 9 PA f ( text is that)3 473(The problem with)2 737 2 970 1502 t 7 PA f (IDEAL)2214 1502 w 9 PA f (operates as a)2 535 1 2467 1502 t 7 PA f (TROFF)3036 1502 w 9 PA f (preprocessor, so it cannot determine)4 1497 1 3293 1502 t ( and it needs to know that if it is to do anything involving)13 2393(anything about the size of the text,)6 1427 2 970 1612 t (opaquing and text.)2 752 1 970 1722 t ( chopped, it is easy to)5 907( a line or circular arc is)6 952( When)1 291(The problem with splines is more subtle.)6 1670 4 970 1904 t ( the guiding points)3 766( when a spline is chopped,)5 1076( But)1 189(specify the lines or circular arcs that remain.)7 1789 4 970 2014 t (of the resulting curve pieces are hard to determine.)8 2033 1 970 2124 t 10 PB f ( Commands)1 547(7. Paper)1 386 2 720 2400 t 8 PA f (IDEAL)970 2556 w 10 PA f (includes two commands that are analogous to the way people draw on paper.)12 3441 1 1244 2556 t 10 PB f (7.1. Construct)1 643 1 720 2796 t 10 PA f (The)970 2952 w 10 PI f (construct)1171 2952 w 10 PA f ( statement, with the keyword)4 1339(statement looks just like a put)5 1363 2 1595 2952 t 10 PI f (put)4332 2952 w 10 PA f (replaced by)1 526 1 4514 2952 t 10 PI f (construct)720 3072 w 10 PA f ( think of it as laying a sheet of tracing paper over the current drawing.)14 3312( is best to)3 460(. It)1 158 3 1110 3072 t ( you return to the layer underneath, you)7 1792( When)1 315(Anything constructed will be drawn on this sheet.)7 2213 3 720 3192 t ( with a put statement, but the lines and curves in the con-)12 2532(may refer to any of the local variables as)8 1788 2 720 3312 t (structed picture don't show.)3 1248 1 720 3432 t 0.1 setlinewidth 4125 4600 4140 4632 Dl 4140 4631 4155 4599 Dl 10 S f (\347)4140 4632 w (\347)4140 4572 w (\347)4140 4472 w (\347)4140 4372 w 10 PA f (bottom)3981 4812 w (top)4066 4092 w 9 CW f (main {)1 324 1 1080 3602 t (construct A: rect {)3 1026 1 1512 3712 t (sw = 0;)2 378 1 1944 3822 t (wd = ht = 1;)4 648 1 1944 3932 t (};)1512 4042 w (construct B: rect {)3 1026 1 1512 4152 t (n = A.s - \(0,1\);)4 864 1 1944 4262 t (wd = ht = 1;)4 648 1 1944 4372 t (};)1512 4482 w ('top' at A.c;)2 702 1 1512 4592 t ('bottom' at B.c;)2 864 1 1512 4702 t (put arrow {)2 594 1 1512 4812 t (hd = B.n;)2 486 1 1944 4922 t (tl = A.s;)2 486 1 1944 5032 t (};)1512 5142 w (})1080 5252 w 10 PA f ( the)1 179(Here we have used ``invisible boxes'' to place the arrow around the text without drawing)14 4141 2 720 5468 t (boxes.)720 5588 w 10 PB f (7.2. Draw)1 455 1 720 5828 t 10 PA f ( saw)1 208( We)1 206(The construct command may also be used to localize the effects of opaque boxes.)13 3656 3 970 5984 t ( the exterior of the polygon.)5 1235(above how to draw a \256lled polygon: paint over the area, then opaque)12 3085 2 720 6104 t (But how can we draw)4 967 1 720 6224 t 10 PI f (two)1712 6224 w 10 PA f (\256lled polygons in the same picture?)5 1576 1 1894 6224 t (One solution is to construct them both, then use the)9 2413 1 970 6380 t 10 PI f (draw)3423 6380 w 10 PA f (command to add them to the)5 1363 1 3677 6380 t ( the contents of the named sheet of tracing paper to)10 2335( draw command transfers)3 1163( The)1 225(main picture.)1 597 4 720 6500 t (the sheet below.)2 713 1 720 6620 t cleartomark showpage saveobj restore %%EndPage: 15 17 %%Page: 16 18 /saveobj save def mark 18 pagesetup 10 PA f (- 16 -)2 216 1 2772 480 t 0.1 setlinewidth 3591 1204 728 728 De 4247 1047 4279 1036 Dl 4256 999 4174 970 Dl 4175 969 4220 953 Dl 4247 1152 4312 1129 Dl 4310 1122 4174 1074 Dl 4175 1074 4247 1048 Dl 4248 1255 4319 1230 Dl 4318 1229 4174 1178 Dl 4175 1178 4247 1152 Dl 4247 1360 4291 1344 Dl 4298 1326 4174 1282 Dl 4175 1282 4247 1256 Dl 4252 1414 4174 1386 Dl 4175 1386 4247 1360 Dl 4178 1491 4174 1490 Dl 4174 1490 4186 1486 Dl 4102 944 4174 918 Dl 4173 918 4028 866 Dl 4029 865 4059 855 Dl 4102 1048 4174 1022 Dl 4173 1022 4028 970 Dl 4029 970 4101 944 Dl 4102 1152 4174 1126 Dl 4173 1126 4028 1074 Dl 4029 1074 4101 1048 Dl 4102 1256 4174 1230 Dl 4173 1230 4028 1178 Dl 4029 1178 4101 1152 Dl 4102 1360 4174 1334 Dl 4173 1334 4028 1282 Dl 4029 1282 4101 1256 Dl 4102 1464 4174 1438 Dl 4173 1438 4028 1386 Dl 4029 1386 4101 1360 Dl 4126 1525 4028 1490 Dl 4029 1490 4101 1464 Dl 3956 944 4028 918 Dl 4027 918 3882 866 Dl 3883 866 3955 840 Dl 3956 1048 4028 1022 Dl 4027 1022 3882 970 Dl 3883 970 3955 944 Dl 3956 1152 4028 1126 Dl 4027 1126 3882 1074 Dl 3883 1074 3955 1048 Dl 3956 1256 4028 1230 Dl 4027 1230 3882 1178 Dl 3883 1178 3955 1152 Dl 3956 1360 4028 1334 Dl 4027 1334 3882 1282 Dl 3883 1282 3955 1256 Dl 3956 1464 4028 1438 Dl 4027 1438 3882 1386 Dl 3883 1386 3955 1360 Dl 3956 1568 4028 1542 Dl 4027 1542 3882 1490 Dl 3883 1490 3955 1464 Dl 3810 944 3882 918 Dl 3882 917 3784 882 Dl 3810 1048 3882 1022 Dl 3881 1022 3736 970 Dl 3737 970 3809 944 Dl 3810 1152 3882 1126 Dl 3881 1126 3736 1074 Dl 3737 1074 3809 1048 Dl 3810 1256 3882 1230 Dl 3881 1230 3736 1178 Dl 3737 1178 3809 1152 Dl 3810 1360 3882 1334 Dl 3881 1334 3736 1282 Dl 3737 1282 3809 1256 Dl 3810 1464 3882 1438 Dl 3881 1438 3736 1386 Dl 3737 1386 3809 1360 Dl 3852 1552 3882 1542 Dl 3881 1542 3736 1490 Dl 3737 1490 3809 1464 Dl 3724 922 3736 918 Dl 3736 917 3732 916 Dl 3664 1048 3736 1022 Dl 3735 1022 3657 994 Dl 3664 1152 3736 1126 Dl 3736 1125 3612 1081 Dl 3619 1064 3663 1048 Dl 3664 1256 3736 1230 Dl 3735 1229 3591 1178 Dl 3592 1177 3663 1152 Dl 3664 1360 3736 1334 Dl 3736 1333 3600 1285 Dl 3598 1279 3663 1256 Dl 3691 1454 3736 1438 Dl 3735 1438 3653 1409 Dl 3631 1371 3663 1360 Dl 3226 840 2880 1091 Dl 2880 1092 3012 1499 Dl 10 S1 f (_ ________)1 428 1 3012 1499 t 3441 1498 3573 1091 Dl 3572 1091 3226 840 Dl 3337 1498 3356 1443 Dl 3357 1444 3376 1499 Dl 3233 1498 3252 1443 Dl 3253 1444 3272 1499 Dl 3129 1498 3148 1443 Dl 3149 1444 3168 1499 Dl 3025 1498 3044 1443 Dl 3045 1444 3064 1499 Dl 3382 1413 3408 1485 Dl 3408 1484 3460 1339 Dl 3461 1340 3477 1386 Dl 3278 1413 3304 1485 Dl 3304 1484 3356 1339 Dl 3356 1340 3382 1412 Dl 3174 1413 3200 1485 Dl 3200 1484 3252 1339 Dl 3252 1340 3278 1412 Dl 3070 1413 3096 1485 Dl 3096 1484 3148 1339 Dl 3148 1340 3174 1412 Dl 3001 1461 3044 1339 Dl 3044 1340 3070 1412 Dl 3487 1308 3495 1331 Dl 3382 1309 3408 1381 Dl 3408 1380 3460 1235 Dl 3460 1236 3486 1308 Dl 3278 1309 3304 1381 Dl 3304 1380 3356 1235 Dl 3356 1236 3382 1308 Dl 3174 1309 3200 1381 Dl 3200 1380 3252 1235 Dl 3252 1236 3278 1308 Dl 3070 1309 3096 1381 Dl 3096 1380 3148 1235 Dl 3148 1236 3174 1308 Dl 2966 1309 2992 1381 Dl 2992 1380 3044 1235 Dl 3044 1236 3070 1308 Dl 2933 1254 2940 1235 Dl 2940 1236 2966 1308 Dl 3486 1205 3512 1277 Dl 3382 1205 3408 1277 Dl 3408 1276 3460 1131 Dl 3460 1132 3486 1204 Dl 3278 1205 3304 1277 Dl 3304 1276 3356 1131 Dl 3356 1132 3382 1204 Dl 3174 1205 3200 1277 Dl 3200 1276 3252 1131 Dl 3252 1132 3278 1204 Dl 3070 1205 3096 1277 Dl 3096 1276 3148 1131 Dl 3148 1132 3174 1204 Dl 2966 1205 2992 1277 Dl 2992 1276 3044 1131 Dl 3044 1132 3070 1204 Dl 2916 1200 2940 1131 Dl 2940 1132 2966 1204 Dl 3486 1101 3512 1173 Dl 3513 1172 3548 1073 Dl 3382 1101 3408 1173 Dl 3408 1172 3460 1027 Dl 3460 1028 3486 1100 Dl 3278 1101 3304 1173 Dl 3304 1172 3356 1027 Dl 3356 1028 3382 1100 Dl 3174 1101 3200 1173 Dl 3200 1172 3252 1027 Dl 3252 1028 3278 1100 Dl 3070 1101 3096 1173 Dl 3096 1172 3148 1027 Dl 3148 1028 3174 1100 Dl 2966 1101 2992 1173 Dl 2992 1172 3044 1027 Dl 3044 1028 3070 1100 Dl 2898 1146 2930 1055 Dl 2946 1044 2966 1100 Dl 3502 1041 3512 1069 Dl 3513 1068 3518 1052 Dl 3382 997 3408 1069 Dl 3409 1068 3436 992 Dl 3278 997 3304 1069 Dl 3305 1068 3353 932 Dl 3362 939 3382 996 Dl 3174 997 3200 1069 Dl 3200 1068 3252 923 Dl 3252 924 3278 996 Dl 3070 997 3096 1069 Dl 3096 1068 3148 923 Dl 3148 924 3174 996 Dl 2976 1023 2992 1069 Dl 2992 1068 3020 989 Dl 3058 963 3070 996 Dl 3278 892 3304 964 Dl 3305 964 3324 910 Dl 3174 892 3200 964 Dl 3201 964 3241 850 Dl 3272 873 3278 892 Dl 3088 940 3096 964 Dl 3097 964 3111 923 Dl 3170 881 3174 892 Dl 9 CW f (null {)1 324 1 1080 890 t (})1080 1000 w (pentagon {)1 540 1 1080 1220 t (var center, radius,)2 1026 1 1512 1330 t (pt1, pt2, pt3, pt4, pt5;)4 1296 1 1944 1440 t (pt1 = center + radius;)4 1188 1 1512 1550 t (pt2 = center + cis\(72\)*radius;)4 1620 1 1512 1660 t (pt3 = center + cis\(144\)*radius;)4 1674 1 1512 1770 t (pt4 = center + cis\(-144\)*radius;)4 1728 1 1512 1880 t (pt5 = center + cis\(-72\)*radius;)4 1674 1 1512 1990 t (conn pt1 to pt2 to pt3 to pt4 to pt5 to pt1;)11 2376 1 1512 2100 t (bdlist = pt1, pt2, pt3, pt4, pt5;)6 1782 1 1512 2210 t (})1080 2320 w (main {)1 324 1 1080 2540 t (construct A: null {)3 1026 1 1512 2650 t (conn \(0,1\) to 0)3 810 1 1944 2760 t (using 7 brush {)3 810 1 2376 2870 t (bwd = 1;)2 432 1 2808 2980 t (bht = 0.1;)2 540 1 2808 3090 t (};)2808 3200 w (put pentagon {)2 756 1 1944 3310 t (center = \(0,0.5\);)2 918 1 2376 3420 t (radius = \(0,0.5\);)2 918 1 2376 3530 t (opaque exterior;)1 864 1 2376 3640 t (};)1944 3750 w (};)1512 3860 w (construct B: null {)3 1026 1 1512 3970 t (conn \(0.5,0.5\) to \(1.5,0.5\))3 1458 1 1944 4080 t (using 5 brush {)3 810 1 2376 4190 t (bwd = \(0,1\);)2 648 1 2808 4300 t (bht = 0.1;)2 540 1 2808 4410 t (};)2808 4520 w (put circle {)2 648 1 1944 4630 t (center = \(1,0.5\);)2 918 1 2376 4740 t (radius = 0.5;)2 702 1 2376 4850 t (opaque exterior;)1 864 1 2376 4960 t (};)1944 5070 w (};)1512 5180 w (draw A;)1 378 1 1512 5290 t (draw B;)1 378 1 1512 5400 t (})1080 5510 w 10 PA f ( sections of construct \(and put\) statements!)6 1961(Even put statements can be added to the parameter)8 2359 2 720 5726 t (Believe it or not, box)4 925 1 720 5846 t 10 PI f (null)1674 5846 w 10 PA f (de\256ned above is one of the most useful: it gives us a way to name a set)16 3162 1 1878 5846 t (of commands and variables so that we may reference them later, yet it doesn't require us to)16 4320 1 720 5966 t (de\256ne a box that will be used only once.)8 1774 1 720 6086 t ( a special box)3 634(Given construct and draw, why do we need)7 2036 2 970 6242 t 10 PI f (hole)3680 6242 w 10 PA f (to opaque a circular area)4 1151 1 3889 6242 t ( opaque circle, then draw it on the main)8 1838( not just construct an)4 965( Why)1 275(without drawing anything?)2 1242 4 720 6362 t ( much as the drawing, so an)6 1244( problem is that the effect of opaquing is localized just as)11 2501(picture? The)1 575 3 720 6482 t (opaque constructed circle won't opaque anything that lies underneath.)8 3126 1 720 6602 t cleartomark showpage saveobj restore %%EndPage: 16 18 %%Page: 17 19 /saveobj save def mark 19 pagesetup 10 PA f (- 17 -)2 216 1 2772 480 t 10 PB f ( Files)1 241(8. Library)1 464 2 720 840 t 10 PA f ( special \256gures like circles and)5 1396(Library \256les are available to draw common \256gures and for)9 2674 2 970 996 t ( include a library \256le as part of an)8 1487(arcs. To)1 367 2 720 1116 t 8 PA f (IDEAL)2599 1116 w 10 PA f (program, include the line)3 1121 1 2873 1116 t 9 CW f (...libfile)1080 1286 w 9 PI f (name)1674 1286 w 10 PA f (in your)1 333 1 720 1466 t 8 PA f (IDEAL)1088 1466 w 10 PA f ( section)1 345( This)1 251( lines that mark its start and end.\))7 1562(program \(between the .IS and .IE)5 1510 4 1372 1466 t (describes available library \256les that have been alluded to up to now.)11 3009 1 720 1586 t 10 PB f (8.1. Rectangle)1 649 1 720 1826 t 10 PA f (File)970 1982 w 10 PI f (rect)1159 1982 w 10 PA f (contains the de\256nition of box)4 1302 1 1346 1982 t 10 PI f (rect)2676 1982 w 10 PA f (, which looks like the de\256nition in Section 3, with)9 2204 1 2836 1982 t (\256ve more variables:)2 890 1 720 2102 t 10 PI f (n)1670 2102 w 10 PA f (,)1726 2102 w 10 PI f (s)1786 2102 w 10 PA f (,)1825 2102 w 10 PI f (e)1885 2102 w 10 PA f (,)1924 2102 w 10 PI f (w)1984 2102 w 10 PA f (, and)1 229 1 2056 2102 t 10 PI f (c)2320 2102 w 10 PA f (, which are the four compass points and the center, respec-)10 2679 1 2361 2102 t (tively.)720 2222 w 9 CW f (rect {)1 324 1 1080 2392 t (var ne, nw, sw, se,)4 1026 1 1512 2502 t (n, e, w, s, c,)4 756 1 1512 2612 t (ht, wd;)1 378 1 1512 2722 t (ne = se + \(0,1\)*ht;)4 1026 1 1512 2832 t (nw = sw + \(0,1\)*ht;)4 1026 1 1512 2942 t (ne = nw + wd;)4 702 1 1512 3052 t (n = \(ne+nw\)/2;)2 756 1 1512 3162 t (s = \(se+sw\)/2;)2 756 1 1512 3272 t (e = \(ne+se\)/2;)2 756 1 1512 3382 t (w = \(nw+sw\)/2;)2 756 1 1512 3492 t (c = \(ne+sw\)/2;)2 756 1 1512 3602 t (ht \304 1;)2 378 1 1512 3712 t (wd \304 1.5;)2 486 1 1512 3822 t (bdlist = ne, nw, sw, se;)5 1296 1 1512 3932 t (conn ne to nw to sw to se to ne;)9 1728 1 1512 4042 t (})1080 4152 w 10 PB f (8.2. Arrow)1 495 1 720 4452 t 10 PA f (File)970 4608 w 10 PI f (arrow)1157 4608 w 10 PA f (contains the de\256nition of box)4 1290 1 1428 4608 t 10 PI f (arrow)2743 4608 w 10 PA f (as given in Section 3.)4 921 1 3014 4608 t 9 CW f (arrow {)1 378 1 1080 4778 t (var tl, hd, head, perp, headang;)5 1728 1 1512 4888 t (conn tl to hd;)3 756 1 1512 4998 t (perp = head*\(tl-hd\)/abs\(tl-hd\);)2 1674 1 1512 5108 t (conn hd + cis\(headang\)*perp to hd to hd + cis\(-headang\)*perp;)9 3294 1 1512 5218 t (head \304 0.1;)2 594 1 1512 5328 t (headang \304 25;)2 702 1 1512 5438 t (})1080 5548 w 10 PB f (8.3. Wavy)1 462 1 720 5848 t 10 PA f (Library \256le)1 494 1 970 6004 t 10 PI f (wavy)1489 6004 w 10 PA f (contains the de\256nition for the familiar)5 1680 1 1738 6004 t 10 PI f (wavy)3443 6004 w 10 PA f (.)3667 6004 w 9 CW f (wavy {)1 324 1 1080 6174 t (var start, end, perp, pt1, pt2, ht;)6 1890 1 1512 6284 t (perp = \(0,1\)*\(start - end\)/abs\(start - end\);)6 2376 1 1512 6394 t (pt1 = 0.25[start,end] + perp*ht;)4 1728 1 1512 6504 t (pt2 = 0.75[start,end] - perp*ht;)4 1728 1 1512 6614 t (conn start to pt1 to pt2 to end;)7 1728 1 1512 6724 t (})1080 6834 w cleartomark showpage saveobj restore %%EndPage: 17 19 %%Page: 18 20 /saveobj save def mark 20 pagesetup 10 PA f (- 18 -)2 216 1 2772 480 t 10 PB f (8.4. Dash)1 438 1 720 840 t 10 PA f (Library \256le)1 516 1 970 996 t 10 PI f (dash)1533 996 w 10 PA f (contains the de\256nition of box)4 1378 1 1771 996 t 10 PI f (dash)3196 996 w 10 PA f (, which may be useful for drawing)6 1653 1 3387 996 t (dashed lines:)1 576 1 720 1116 t 9 CW f (dash {)1 324 1 1080 1286 t (var start, end;)2 810 1 1512 1396 t (conn start to 0.25[start,end];)3 1620 1 1512 1506 t (conn 0.75[start,end] to end;)3 1512 1 1512 1616 t (})1080 1726 w 10 PB f (8.5. Circles)1 515 1 720 2026 t 10 PA f (Box)970 2182 w 10 PI f (circle)1166 2182 w 10 PA f (resides in a library \256le of the same name, and has the local variables described in)15 3622 1 1418 2182 t (Section 3:)1 420 1 720 2302 t 10 PI f (center)1165 2302 w 10 PA f (,)1412 2302 w 10 PI f (radius)1462 2302 w 10 PA f (,)1718 2302 w 10 PI f (z)1768 2302 w 10 PA f (1,)1820 2302 w 10 PI f (z)1920 2302 w 10 PA f (2, and)1 269 1 1972 2302 t 10 PI f (z)2266 2302 w 10 PA f (3.)2318 2302 w 9 PA f (Box)970 2448 w 9 PI f (circle)1155 2448 w 9 PA f ( and a put of box)5 732(actually consists of variable declarations)4 1647 2 1389 2448 t 9 PI f (CIRCLE)3802 2448 w 9 PA f ( if you will)3 465(. So,)1 201 2 4124 2448 t ( radius, it might be easier for you to de\256ne your own, say,)12 2350(have many circles of a particular)5 1317 2 970 2558 t 9 PI f (cir-)4663 2558 w (cle)970 2668 w 9 PA f (3:)1074 2668 w 8 CW f (circle {)1 384 1 1330 2828 t (var center, radius, z1, z2, z3;)5 1488 1 1714 2928 t (put CIRCLE {)2 576 1 1714 3028 t (radius = 3;)2 528 1 2098 3128 t (})1714 3228 w (})1330 3328 w 10 PB f (8.6. Arcs)1 405 1 720 3664 t 10 PA f (Box)970 3820 w 10 PI f (arc)1170 3820 w 10 PA f ( local variables as described in)5 1378(is contained in a library \256le of the same name, with)10 2328 2 1334 3820 t (Section 3:)1 420 1 720 3940 t 10 PI f (center)1165 3940 w 10 PA f (,)1412 3940 w 10 PI f (radius)1462 3940 w 10 PA f (,)1718 3940 w 10 PI f (start)1768 3940 w 10 PA f (,)1956 3940 w 10 PI f (midway)2006 3940 w 10 PA f (,)2328 3940 w 10 PI f (end)2378 3940 w 10 PA f (,)2523 3940 w 10 PI f (startang)2573 3940 w 10 PA f (,)2911 3940 w 10 PI f (midang)2961 3940 w 10 PA f (, and)1 219 1 3267 3940 t 10 PI f (endang)3511 3940 w 10 PA f (.)3806 3940 w 9 PA f (As above,)1 392 1 970 4086 t 9 PI f (arc)1385 4086 w 9 PA f (calls on a box called)4 796 1 1527 4086 t 9 PI f (ARC)2346 4086 w 9 PA f (.)2538 4086 w 10 PB f (9. Examples)1 563 1 720 4362 t (9.1. B-Trees)1 550 1 720 4602 t 10 PA f (This example depicts a B-tree whose nodes have many children.*)9 2865 1 970 4758 t 8 S1 f (__________________)720 6980 w 8 PA f (*P. J. Weinberger, Unix B-trees, Bell Laboratories, 1981.)7 1936 1 720 7080 t cleartomark showpage saveobj restore %%EndPage: 18 20 %%Page: 19 21 /saveobj save def mark 21 pagesetup 10 PA f (- 19 -)2 216 1 2772 480 t (. . . .)3 559 1 2346 1507 t 10 S f (\267)3492 2797 w (\267)3670 2708 w (\267)3848 2619 w (\267)2602 2352 w (\267)2780 2263 w (\267)2958 2174 w 0.1 setlinewidth 2128 1204 2091 1284 Dl 2091 1284 2171 1247 Dl 2535 840 2091 1284 Dl 3028 2007 3070 2085 Dl 3070 2085 3087 1998 Dl 2982 1507 3070 2085 Dl 2482 2282 2536 2352 Dl 2536 2352 2539 2264 Dl 2270 1507 2536 2352 Dl 2232 2406 2269 2486 Dl 2269 2486 2291 2400 Dl 2181 1508 2269 2486 Dl 1979 2534 2002 2619 Dl 2002 2619 2039 2539 Dl 2090 1507 2002 2619 Dl 10 S1 f (_ _________________)1 889 1 2002 2619 t 10 S f (\347)2002 3064 w (\347)2002 3020 w (\347)2002 2920 w (\347)2002 2820 w (\347)2002 2720 w 10 S1 f (_ _________________)1 889 1 2003 3064 t 10 S f (\347)2892 2719 w (\347)2892 2763 w (\347)2892 2863 w (\347)2892 2963 w (\347)2892 3063 w 3029 3178 3094 3238 Dl 3093 3238 3083 3150 Dl 2892 2842 3094 3238 Dl 2624 3204 2667 3281 Dl 2668 3281 2684 3194 Dl 2598 2842 2667 3281 Dl 2210 3194 2226 3281 Dl 2226 3281 2269 3204 Dl 2295 2842 2226 3281 Dl 1810 3150 1800 3238 Dl 1800 3238 1865 3178 Dl 2002 2842 1800 3238 Dl 10 S1 f (_ _________________)1 889 1 2269 2486 t 2269 2486 2269 2619 Dl (_ _____)1 266 1 2893 2931 t 10 S f (\347)3159 2586 w (\347)3159 2630 w (\347)3159 2730 w (\347)3159 2830 w (\347)3159 2930 w 10 S1 f (_ _________________)1 889 1 2536 2352 t 2536 2353 2536 2486 Dl (_ _____)1 266 1 3160 2797 t 10 S f (\347)3426 2452 w (\347)3426 2496 w (\347)3426 2596 w (\347)3426 2696 w (\347)3426 2796 w 10 S1 f (_ _________________)1 889 1 3070 2085 t 10 S f (\347)3070 2352 w (\347)3070 2286 w (\347)3070 2186 w 10 S1 f (_ __________)1 533 1 3427 2530 t 10 S f (\347)3960 2185 w (\347)3960 2229 w (\347)3960 2329 w (\347)3960 2429 w (\347)3960 2529 w 10 S1 f (_ _________________)1 889 1 2091 1284 t 10 S f (\347)2091 1729 w (\347)2091 1685 w (\347)2091 1585 w (\347)2091 1485 w (\347)2091 1385 w 10 S1 f (_ _________________)1 889 1 2092 1729 t 10 S f (\347)2981 1384 w (\347)2981 1428 w (\347)2981 1528 w (\347)2981 1628 w (\347)2981 1728 w cleartomark showpage saveobj restore %%EndPage: 19 21 %%Page: 20 22 /saveobj save def mark 22 pagesetup 10 PA f (- 20 -)2 216 1 2772 480 t 9 CW f (...libfile rect)1 810 1 1080 890 t (arrow {)1 378 1 1080 1000 t (var tl, hd, headvec, head;)4 1404 1 1512 1110 t (headvec = hd + head*\(tl - hd\)/abs\(tl - hd\);)8 2322 1 1512 1220 t (conn tl to hd;)3 756 1 1512 1330 t (conn hd + cis\(20\)*\(headvec - hd\))5 1728 1 1512 1440 t (to hd)1 270 1 1944 1550 t (to hd + cis\(-20\)*\(headvec - hd\);)5 1728 1 1944 1660 t (})1080 1770 w (dot {)1 270 1 1080 1990 t (var s, e;)2 486 1 1512 2100 t ('\\\(bu' at 0.5[s, e] - \(0,0.1\);)5 1620 1 1512 2210 t (})1080 2320 w (per {)1 270 1 1080 2540 t (var s, e;)2 486 1 1512 2650 t ('.' at 0.5[s, e];)3 918 1 1512 2760 t (})1080 2870 w (main {)1 324 1 1080 3090 t (var rw, rh;)2 594 1 1512 3200 t (rw = 2;)2 378 1 1512 3310 t (rh = 1;)2 378 1 1512 3420 t (var hmv, vmv;)2 702 1 1512 3530 t (hmv = 0.6;)2 540 1 1512 3640 t (vmv = 0.3;)2 540 1 1512 3750 t (var ah;)1 378 1 1512 3860 t (ah = 0.2;)2 486 1 1512 3970 t (put root: rect {)3 864 1 1512 4080 t (sw = \(0,1\);)2 594 1 1944 4190 t (wd = rw;)2 432 1 1944 4300 t (ht = 1;)2 378 1 1944 4410 t (};)1512 4520 w (put next: rect {)3 864 1 1512 4630 t (sw = youngest.sw + 2*\(hmv, vmv\);)5 1728 1 1944 4740 t (wd = rw;)2 432 1 1944 4850 t (ht = rh;)2 432 1 1944 4960 t (};)1512 5070 w (put youngest: rect {)3 1080 1 1512 5180 t (sw = bro.sw + \(hmv, vmv\);)5 1350 1 1944 5290 t (wd = rw;)2 432 1 1944 5400 t (ht = rh;)2 432 1 1944 5510 t (opaque;)1944 5620 w (};)1512 5730 w (put bro: rect {)3 810 1 1512 5840 t (sw = eldest.sw + \(hmv, vmv\);)5 1512 1 1944 5950 t (wd = rw;)2 432 1 1944 6060 t (ht = rh;)2 432 1 1944 6170 t (opaque;)1944 6280 w (};)1512 6390 w (put eldest: rect {)3 972 1 1512 6500 t (im\(nw\) = im\(3[root.nw,root.sw]\);)2 1728 1 1944 6610 t (re\(0.5[nw, next.nw]\) = re\(0.5[root.nw, root.ne]\);)4 2646 1 1944 6720 t (wd = rw;)2 432 1 1944 6830 t (ht = rh;)2 432 1 1944 6940 t (opaque;)1944 7050 w (put arrow {)2 594 1 1944 7160 t (head = ah;)2 540 1 2376 7270 t cleartomark showpage saveobj restore %%EndPage: 20 22 %%Page: 21 23 /saveobj save def mark 23 pagesetup 10 PA f (- 21 -)2 216 1 2772 480 t 9 CW f (tl = 0.0[sw, se] + 0.5 * \(nw - sw\);)9 1890 1 2376 830 t (hd = tl - \(0, 1\) * cis\(-27\);)7 1512 1 2376 940 t (};)1944 1050 w (put arrow {)2 594 1 1944 1160 t (head = ah;)2 540 1 2376 1270 t (tl = 0.33[sw, se] + 0.5 * \(nw -sw\);)8 1890 1 2376 1380 t (hd = tl - \(0,1\) * cis\(-9\);)6 1404 1 2376 1490 t (};)1944 1600 w (put arrow {)2 594 1 1944 1710 t (head = ah;)2 540 1 2376 1820 t (tl = 0.67[sw, se] + 0.5 * \(nw - sw\);)9 1944 1 2376 1930 t (hd = tl - \(0,1\) * cis\(9\);)6 1350 1 2376 2040 t (};)1944 2150 w (put arrow {)2 594 1 1944 2260 t (head = ah;)2 540 1 2376 2370 t (tl = 1.0[sw, se] + 0.5 * \(nw -sw\);)8 1836 1 2376 2480 t (hd = tl - \(0,1\) * cis\(27\);)6 1404 1 2376 2590 t (};)1944 2700 w (};)1512 2810 w (put arrow {)2 594 1 1512 2920 t (head = ah;)2 540 1 1944 3030 t (tl=root.sw + 0.5 * \(root.nw - root.sw\);)6 2106 1 1944 3140 t (hd=eldest.nw;)1944 3250 w (};)1512 3360 w (put arrow {)2 594 1 1512 3470 t (head = ah;)2 540 1 1944 3580 t (tl=0.1[root.sw,root.se] + 0.5 * \(root.nw - root.sw\);)6 2808 1 1944 3690 t (hd=bro.nw;)1944 3800 w (};)1512 3910 w (put a: arrow {)3 756 1 1512 4020 t (head = ah;)2 540 1 1944 4130 t (tl=0.2[root.sw,root.se] + 0.5 * \(root.nw - root.sw\);)6 2808 1 1944 4240 t (hd=youngest.nw;)1944 4350 w (};)1512 4460 w (put b: arrow {)3 756 1 1512 4570 t (head = ah;)2 540 1 1944 4680 t (tl = 0.5[root.ne, root.se];)3 1458 1 1944 4790 t (hd = next.nw;)2 702 1 1944 4900 t (};)1512 5010 w (put arrow {)2 594 1 1512 5120 t (head = ah;)2 540 1 1944 5230 t (hd = root.nw;)2 702 1 1944 5340 t (tl = 0.5[root.nw, root.ne] + \(0, 1.0\);)6 2052 1 1944 5450 t (};)1512 5560 w (conn next.nw to youngest.nw using 3 dot{};)7 2592 1 1512 5670 t (conn next.se to youngest.se using 3 dot{};)7 2592 1 1512 5780 t (conn b.tl to a.tl using 4 per{};)7 2052 1 1512 5890 t (})1080 6000 w 10 PB f ( Sector Grid)2 549(9.2. A)1 278 2 720 6300 t 10 PA f ( to \256nd the area of)5 813(Norm Schryer used this \256gure to show how numerical integration is used)11 3257 2 970 6456 t (planar regions.)1 665 1 720 6576 t cleartomark showpage saveobj restore %%EndPage: 21 23 %%Page: 22 24 /saveobj save def mark 24 pagesetup 10 PA f (- 22 -)2 216 1 2772 480 t 10 S f (\347)4248 1930 w (\347)4248 1979 w (\347)4248 2079 w (\347)4248 2179 w (\347)4248 2279 w (\347)4176 1752 w (\347)4176 1779 w (\347)4176 1879 w (\347)4176 1979 w (\347)4176 2079 w (\347)4176 2179 w (\347)4176 2279 w (\347)4104 1621 w (\347)4104 1679 w (\347)4104 1779 w (\347)4104 1879 w (\347)4104 1979 w (\347)4104 2079 w (\347)4104 2179 w (\347)4104 2279 w (\347)4032 1516 w (\347)4032 1580 w (\347)4032 1680 w (\347)4032 1780 w (\347)4032 1880 w (\347)4032 1980 w (\347)4032 2080 w (\347)4032 2180 w (\347)4032 2280 w (\347)3960 1427 w (\347)3960 1479 w (\347)3960 1579 w (\347)3960 1679 w (\347)3960 1779 w (\347)3960 1879 w (\347)3960 1979 w (\347)3960 2079 w (\347)3960 2179 w (\347)3960 2279 w (\347)3888 1351 w (\347)3888 1379 w (\347)3888 1479 w (\347)3888 1579 w (\347)3888 1679 w (\347)3888 1779 w (\347)3888 1879 w (\347)3888 1979 w (\347)3888 2079 w (\347)3888 2179 w (\347)3888 2279 w (\347)3816 1285 w (\347)3816 1379 w (\347)3816 1479 w (\347)3816 1579 w (\347)3816 1679 w (\347)3816 1779 w (\347)3816 1879 w (\347)3816 1979 w (\347)3816 2079 w (\347)3816 2179 w (\347)3816 2279 w (\347)3744 1228 w (\347)3744 1280 w (\347)3744 1380 w (\347)3744 1480 w (\347)3744 1580 w (\347)3744 1680 w (\347)3744 1780 w (\347)3744 1880 w (\347)3744 1980 w (\347)3744 2080 w (\347)3744 2180 w (\347)3744 2280 w (\347)3672 1177 w (\347)3672 1179 w (\347)3672 1279 w (\347)3672 1379 w (\347)3672 1479 w (\347)3672 1579 w (\347)3672 1679 w (\347)3672 1779 w (\347)3672 1879 w (\347)3672 1979 w (\347)3672 2079 w (\347)3672 2179 w (\347)3672 2279 w (\347)3600 1132 w (\347)3600 1179 w (\347)3600 1279 w (\347)3600 1379 w (\347)3600 1479 w (\347)3600 1579 w (\347)3600 1679 w (\347)3600 1779 w (\347)3600 1879 w (\347)3600 1979 w (\347)3600 2079 w (\347)3600 2179 w (\347)3600 2279 w (\347)3528 1094 w (\347)3528 1179 w (\347)3528 1279 w (\347)3528 1379 w (\347)3528 1479 w (\347)3528 1579 w (\347)3528 1679 w (\347)3528 1779 w (\347)3528 1879 w (\347)3528 1979 w (\347)3528 2079 w (\347)3528 2179 w (\347)3528 2279 w (\347)3456 1060 w (\347)3456 1079 w (\347)3456 1179 w (\347)3456 1279 w (\347)3456 1379 w (\347)3456 1479 w (\347)3456 1579 w (\347)3456 1679 w (\347)3456 1779 w (\347)3456 1879 w (\347)3456 1979 w (\347)3456 2079 w (\347)3456 2179 w (\347)3456 2279 w (\347)3384 1031 w (\347)3384 1079 w (\347)3384 1179 w (\347)3384 1279 w (\347)3384 1379 w (\347)3384 1479 w (\347)3384 1579 w (\347)3384 1679 w (\347)3384 1779 w (\347)3384 1879 w (\347)3384 1979 w (\347)3384 2079 w (\347)3384 2179 w (\347)3384 2279 w (\347)3312 1006 w (\347)3312 1079 w (\347)3312 1179 w (\347)3312 1279 w (\347)3312 1379 w (\347)3312 1479 w (\347)3312 1579 w (\347)3312 1679 w (\347)3312 1779 w (\347)3312 1879 w (\347)3312 1979 w (\347)3312 2079 w (\347)3312 2179 w (\347)3312 2279 w (\347)3240 985 w (\347)3240 1079 w (\347)3240 1179 w (\347)3240 1279 w (\347)3240 1379 w (\347)3240 1479 w (\347)3240 1579 w (\347)3240 1679 w (\347)3240 1779 w (\347)3240 1879 w (\347)3240 1979 w (\347)3240 2079 w (\347)3240 2179 w (\347)3240 2279 w (\347)3168 969 w (\347)3168 979 w (\347)3168 1079 w (\347)3168 1179 w (\347)3168 1279 w (\347)3168 1379 w (\347)3168 1479 w (\347)3168 1579 w (\347)3168 1679 w (\347)3168 1779 w (\347)3168 1879 w (\347)3168 1979 w (\347)3168 2079 w (\347)3168 2179 w (\347)3168 2279 w (\347)3096 956 w (\347)3096 979 w (\347)3096 1079 w (\347)3096 1179 w (\347)3096 1279 w (\347)3096 1379 w (\347)3096 1479 w (\347)3096 1579 w (\347)3096 1679 w (\347)3096 1779 w (\347)3096 1879 w (\347)3096 1979 w (\347)3096 2079 w (\347)3096 2179 w (\347)3096 2279 w (\347)3024 947 w (\347)3024 979 w (\347)3024 1079 w (\347)3024 1179 w (\347)3024 1279 w (\347)3024 1379 w (\347)3024 1479 w (\347)3024 1579 w (\347)3024 1679 w (\347)3024 1779 w (\347)3024 1879 w (\347)3024 1979 w (\347)3024 2079 w (\347)3024 2179 w (\347)3024 2279 w (\347)2952 941 w (\347)2952 979 w (\347)2952 1079 w (\347)2952 1179 w (\347)2952 1279 w (\347)2952 1379 w (\347)2952 1479 w (\347)2952 1579 w (\347)2952 1679 w (\347)2952 1779 w (\347)2952 1879 w (\347)2952 1979 w (\347)2952 2079 w (\347)2952 2179 w (\347)2952 2279 w (\347)2880 940 w (\347)2880 980 w (\347)2880 1080 w (\347)2880 1180 w (\347)2880 1280 w (\347)2880 1380 w (\347)2880 1480 w (\347)2880 1580 w (\347)2880 1680 w (\347)2880 1780 w (\347)2880 1880 w (\347)2880 1980 w (\347)2880 2080 w (\347)2880 2180 w (\347)2880 2280 w 10 S1 f (_________)2880 912 w (_ ____________)1 627 1 2880 984 t (_ _______________)1 758 1 2880 1056 t (_ _________________)1 864 1 2880 1128 t (_ ___________________)1 952 1 2880 1200 t (_ ____________________)1 1028 1 2880 1272 t (_ _____________________)1 1094 1 2880 1344 t (_ _______________________)1 1152 1 2880 1416 t (_ ________________________)1 1202 1 2880 1488 t (_ ________________________)1 1247 1 2880 1560 t (_ _________________________)1 1285 1 2880 1632 t (_ __________________________)1 1319 1 2880 1704 t (___________________________)2880 1776 w (_ ___________________________)1 1373 1 2880 1848 t (_ ___________________________)1 1394 1 2880 1920 t (_ ____________________________)1 1410 1 2880 1992 t (_ ____________________________)1 1423 1 2880 2064 t (_ ____________________________)1 1432 1 2880 2136 t (_ ____________________________)1 1438 1 2880 2208 t (_ ____________________________)1 1440 1 2880 2280 t 9 CW f (...libfile hole)1 810 1 1080 1440 t (gridline {)1 540 1 1080 1550 t (var a,b;)1 432 1 1512 1660 t (var neg, pos;)2 702 1 1512 1770 t (conn a - neg to a + pos;)7 1296 1 1512 1880 t (})1080 1990 w (main {)1 324 1 1080 2210 t (var n;)1 324 1 1512 2320 t (n = 21;)2 378 1 1512 2430 t (conn \(0,0\) to \(0,1+1/\(n-1\)\))3 1458 1 1512 2540 t (using n gridline {)3 972 1 1944 2650 t (neg = 0;)2 432 1 2376 2760 t (pos = 1;)2 432 1 2376 2870 t (} ;)1 432 1 1944 2980 t (conn \(0,0\) to \(1+1/\(n-1\),0\))3 1458 1 1512 3090 t (using n gridline {)3 972 1 1944 3200 t (neg = 0;)2 432 1 2376 3310 t (pos = \(0,1\);)2 648 1 2376 3420 t (} ;)1 432 1 1944 3530 t (put hole {)2 540 1 1512 3640 t (radius = 1;)2 594 1 1944 3750 t (center = \(0,0\);)2 810 1 1944 3860 t (opaque exterior;)1 864 1 1944 3970 t (};)1512 4080 w (})1080 4190 w 10 PB f ( Clipping)1 435(9.3. Polygon)1 579 2 720 4490 t 10 PA f ( It)1 118( segment with respect to a polygon.)6 1579(This example illustrates all possible positions of a line)8 2373 3 970 4646 t (will appear in a book on graphics and image processing.*)9 2531 1 720 4766 t 8 S1 f (__________________)720 6980 w 8 PA f (*T. Pavlidis, Graphics and Image Processing, to be published.)8 2163 1 720 7080 t cleartomark showpage saveobj restore %%EndPage: 22 24 %%Page: 23 25 /saveobj save def mark 25 pagesetup 10 PA f (- 23 -)2 216 1 2772 480 t 8 PI f (P)3389 6024 w 6 PA f (2)3448 6040 w 8 PA f (\()3490 6024 w 8 PI f (P)3522 6024 w 6 PA f (1)3581 6040 w 8 PA f (\))3623 6024 w 8 PI f (P)3389 5838 w 6 PA f (1)3448 5854 w 8 PA f (\()3490 5838 w 8 PI f (P)3522 5838 w 6 PA f (2)3581 5854 w 8 PA f (\))3623 5838 w 0.1 setlinewidth 3333 6024 18 18 De 3352 5838 -9 0 9 0 Da 8 S f (\347)3342 6672 w (\347)3342 6594 w (\347)3342 6514 w (\347)3342 6434 w (\347)3342 6354 w (\347)3342 6274 w (\347)3342 6194 w (\347)3342 6114 w 3342 5848 3342 6014 Dl (\347)3342 5829 w (\347)3342 5751 w (\347)3342 5671 w (\347)3342 5591 w (\347)3342 5511 w (\347)3342 5431 w (\347)3342 5351 w (\347)3342 5271 w 3574 6331 3805 5931 Dl 2887 6012 3574 6332 Dl 2887 5851 2887 6011 Dl 3538 5512 2887 5851 Dl 3805 5930 3538 5511 Dl 2194 6579 -9 0 9 0 Da 2194 6394 -9 0 9 0 Da 2185 6589 2185 6672 Dl 2185 6404 2185 6570 Dl (\347)2185 6385 w (\347)2185 6311 w (\347)2185 6231 w (\347)2185 6151 w (\347)2185 6071 w (\347)2185 5991 w (\347)2185 5911 w (\347)2185 5831 w (\347)2185 5751 w (\347)2185 5671 w (\347)2185 5591 w (\347)2185 5511 w (\347)2185 5431 w (\347)2185 5351 w (\347)2185 5271 w 2417 6331 2648 5931 Dl 1730 6012 2417 6332 Dl 1729 5851 1729 6011 Dl 2380 5512 1729 5851 Dl 2648 5930 2381 5511 Dl 3352 4542 -9 0 9 0 Da 3352 3987 -9 0 9 0 Da (\347)3342 4820 w (\347)3342 4792 w (\347)3342 4712 w (\347)3342 4632 w (\347)3342 4533 w (\347)3342 4477 w (\347)3342 4397 w (\347)3342 4317 w (\347)3342 4237 w (\347)3342 4157 w (\347)3342 4077 w (\347)3342 3978 w (\347)3342 3900 w (\347)3342 3820 w (\347)3342 3740 w (\347)3342 3660 w (\347)3342 3580 w (\347)3342 3500 w (\347)3342 3420 w 3574 4480 3805 4080 Dl 2887 4160 3574 4480 Dl 2887 4000 2887 4160 Dl 3538 3660 2887 3999 Dl 3805 4079 3538 3660 Dl 2194 4542 -9 0 9 0 Da 2194 3570 -9 0 9 0 Da (\347)2185 4820 w (\347)2185 4792 w (\347)2185 4712 w (\347)2185 4632 w (\347)2185 4533 w (\347)2185 4460 w (\347)2185 4380 w (\347)2185 4300 w (\347)2185 4220 w (\347)2185 4140 w (\347)2185 4060 w (\347)2185 3980 w (\347)2185 3900 w (\347)2185 3820 w (\347)2185 3740 w (\347)2185 3660 w (\347)2185 3561 w (\347)2185 3499 w (\347)2185 3419 w 2417 4480 2648 4080 Dl 1730 4160 2417 4480 Dl 1729 4000 1729 4160 Dl 2380 3660 1729 3999 Dl 2648 4079 2381 3660 Dl 3352 2136 -9 0 9 0 Da 3352 1719 -9 0 9 0 Da (\347)3342 2969 w (\347)3342 2946 w (\347)3342 2866 w (\347)3342 2786 w (\347)3342 2706 w (\347)3342 2626 w (\347)3342 2546 w (\347)3342 2466 w (\347)3342 2386 w (\347)3342 2306 w (\347)3342 2226 w (\347)3342 2126 w (\347)3342 2048 w (\347)3342 1968 w (\347)3342 1888 w (\347)3342 1808 w (\347)3342 1710 w (\347)3342 1648 w (\347)3342 1568 w 3574 2628 3805 2228 Dl 2887 2309 3574 2629 Dl 2887 2148 2887 2308 Dl 3538 1809 2887 2148 Dl 3805 2228 3538 1809 Dl 2194 1580 -9 0 9 0 Da 2194 1719 -9 0 9 0 Da (\347)2185 2969 w (\347)2185 2929 w (\347)2185 2849 w (\347)2185 2769 w (\347)2185 2689 w (\347)2185 2609 w (\347)2185 2529 w (\347)2185 2449 w (\347)2185 2369 w (\347)2185 2289 w (\347)2185 2209 w (\347)2185 2129 w (\347)2185 2049 w (\347)2185 1969 w (\347)2185 1889 w (\347)2185 1809 w 2185 1590 2185 1710 Dl 2185 1488 2185 1571 Dl 2417 2628 2648 2228 Dl 1730 2309 2417 2629 Dl 1729 2148 1729 2308 Dl 2380 1809 1729 2148 Dl 2648 2228 2381 1809 Dl 8 PA f (\(f\))2940 6486 w 8 S f (- - - -)3 215 1 3898 5931 t 8 PI f (P)2232 6579 w 6 PA f (2)2291 6595 w 8 PA f (\()2333 6579 w 8 PI f (P)2365 6579 w 6 PA f (1)2424 6595 w 8 PA f (\))2466 6579 w 8 PI f (P)2232 6394 w 6 PA f (1)2291 6410 w 8 PA f (\()2333 6394 w 8 PI f (P)2365 6394 w 6 PA f (2)2424 6410 w 8 PA f (\))2466 6394 w (\(e\))1771 6486 w 8 S f (- - + +)3 215 1 1729 6243 t 8 PI f (P)3389 4542 w 6 PA f (2)3448 4558 w 8 PA f (\()3490 4542 w 8 PI f (P)3522 4542 w 6 PA f (1)3581 4558 w 8 PA f (\))3623 4542 w 8 PI f (P)3389 3987 w 6 PA f (1)3448 4003 w 8 PA f (\()3490 3987 w 8 PI f (P)3522 3987 w 6 PA f (2)3581 4003 w 8 PA f (\))3623 3987 w (\(d\)\(d1\))2776 4635 w (\()3769 3868 w 8 S f (- - + -)3 215 1 3808 3868 t 8 PA f (\))4036 3868 w 8 S f (- - - +)3 215 1 3769 3799 t 8 PI f (P)2232 4542 w 6 PA f (2)2291 4558 w 8 PA f (\()2333 4542 w 8 PI f (P)2365 4542 w 6 PA f (1)2424 4558 w 8 PA f (\))2466 4542 w 8 PI f (P)2232 3570 w 6 PA f (1)2291 3586 w 8 PA f (\()2333 3570 w 8 PI f (P)2365 3570 w 6 PA f (2)2424 3586 w 8 PA f (\))2466 3570 w (\(c\)\(c1\))1647 4635 w (\()1687 3729 w 8 S f (- + + -)3 215 1 1726 3729 t 8 PA f (\))1954 3729 w 8 S f (+ - - +)3 215 1 1687 3660 t 8 PI f (P)3389 2136 w 6 PA f (2)3448 2152 w 8 PA f (\()3490 2136 w 8 PI f (P)3522 2136 w 6 PA f (1)3581 2152 w 8 PA f (\))3623 2136 w 8 PI f (P)3389 1719 w 6 PA f (1)3448 1735 w 8 PA f (\()3490 1719 w 8 PI f (P)3522 1719 w 6 PA f (2)3581 1735 w 8 PA f (\))3623 1719 w (\(b\)\(b1\))2786 2784 w (\()3769 1878 w 8 S f (- + - -)3 215 1 3808 1878 t 8 PA f (\))4036 1878 w 8 S f (+ - - -)3 215 1 3769 1809 t 8 PI f (P)2232 1580 w 6 PA f (2)2291 1596 w 8 PA f (\()2333 1580 w 8 PI f (P)2365 1580 w 6 PA f (1)2424 1596 w 8 PA f (\))2466 1580 w 8 PI f (P)2232 1719 w 6 PA f (1)2291 1735 w 8 PA f (\()2333 1719 w 8 PI f (P)2365 1719 w 6 PA f (2)2424 1735 w 8 PA f (\))2466 1719 w (\(a\))1769 2784 w 8 S f (+ + - -)3 215 1 1687 1809 t cleartomark showpage saveobj restore %%EndPage: 23 25 %%Page: 24 26 /saveobj save def mark 26 pagesetup 10 PA f (- 24 -)2 216 1 2772 480 t 9 CW f (.ps 8)1 270 1 1080 890 t (.EQ)1080 1000 w (gsize 8)1 378 1 1080 1110 t (define P12 " P sub 1 \( P sub 2 \) ")11 1836 1 1080 1220 t (define P21 " P sub 2 \( P sub 1 \)")10 1782 1 1080 1330 t (.EN)1080 1440 w (...libfile circle)1 918 1 1080 1550 t (...minx -1)1 540 1 1080 1660 t (...maxx 6)1 486 1 1080 1770 t (...miny -1)1 540 1 1080 1880 t (...maxy 12)1 540 1 1080 1990 t (box spot{)1 486 1 1080 2100 t (var loc;)1 432 1 1512 2210 t (put circle{)1 594 1 1512 2320 t (var center, radius;)2 1026 1 1944 2430 t (center = loc;)2 702 1 1944 2540 t (radius = 0.02;)2 756 1 1944 2650 t (opaque;)1944 2760 w (};)1944 2870 w (})1512 2980 w (box vert{)1 486 1 1080 3090 t (var midd, llength;)2 972 1 1512 3200 t (conn midd+llength to midd-llength;)3 1836 1 1512 3310 t (})1512 3420 w (box poly{)1 486 1 1080 3530 t (var c1,p1,p2,p3,p4,p5,r1,tp,bp,ta,tb;)1 1998 1 1512 3640 t (p1 = c1+r1;)2 594 1 1512 3750 t (p2 = cis\(65\)[c1,p1];)2 1080 1 1512 3860 t (p3 = cis\(170\)[c1,p1];)2 1134 1 1512 3970 t (p4 = cis\(190\)[c1,p1];)2 1134 1 1512 4080 t (p5 = cis\(300\)[c1,p1];)2 1134 1 1512 4190 t (tp = c1+\(0,ta\)*r1;)2 972 1 1512 4300 t (bp = c1+\(0,tb\)*r1;)2 972 1 1512 4410 t (conn p1 to p2;)3 756 1 1512 4520 t (conn p2 to p3;)3 756 1 1512 4630 t (conn p3 to p4;)3 756 1 1512 4740 t (conn p4 to p5;)3 756 1 1512 4850 t (conn p5 to p1;)3 756 1 1512 4960 t (put vert{ midd=c1; llength=\(0,1.6\)*r1; };)4 2214 1 1512 5070 t (put spot{ loc=tp; };)3 1080 1 1512 5180 t (put spot{ loc=bp; };)3 1080 1 1512 5290 t (left '$P12$' at tp+0.1;)3 1242 1 1512 5400 t (left '$P21$' at bp+0.1;)3 1242 1 1512 5510 t (})1512 5620 w (box main {)2 540 1 1080 5730 t (put poly{)1 486 1 1512 5840 t (c1 =\(1,9\); r1 = \(1,0\); ta=1.1; tb=1.4;)6 2052 1 1944 5950 t (left '$++--$' at p2-1.5;)3 1296 1 1944 6060 t (right '\(a\)' at c1-\(0.7,1.2\);)3 1512 1 1944 6170 t (};)1944 6280 w (put poly{)1 486 1 1512 6390 t (c1 =\(3.5,9\); r1 = \(1,0\); ta=1.1; tb=0.2;)6 2160 1 1944 6500 t (left '$+---$' at p2+0.5;)3 1296 1 1944 6610 t (left '$\(-+--\)$' at p2+\(0.5,-0.15\);)3 1836 1 1944 6720 t (right '\(b\)\(b1\)' at c1-\(0.7,1.2\);)3 1728 1 1944 6830 t (};)1944 6940 w (put poly{)1 486 1 1512 7050 t (c1 =\(1,5\); r1 = \(1,0\); ta=1.1; tb=-1;)6 1998 1 1944 7160 t (left '$+--+$' at p2-1.5;)3 1296 1 1944 7270 t cleartomark showpage saveobj restore %%EndPage: 24 26 %%Page: 25 27 /saveobj save def mark 27 pagesetup 10 PA f (- 25 -)2 216 1 2772 480 t 9 CW f (left '$\(-++-\)$' at p2-\(1.5,0.15\);)3 1782 1 1944 830 t (right '\(c\)\(c1\)' at c1-\(0.7,1.2\);)3 1728 1 1944 940 t (};)1944 1050 w (put poly{)1 486 1 1512 1160 t (c1 =\(3.5,5\); r1 = \(1,0\); ta=0.2; tb=-1;)6 2106 1 1944 1270 t (left '$---+$' at p2+\(0.5,-0.3\);)3 1674 1 1944 1380 t (left '$\(--+-\)$' at p2+\(0.5,-0.45\);)3 1836 1 1944 1490 t (right '\(d\)\(d1\)' at c1-\(0.7,1.2\);)3 1728 1 1944 1600 t (};)1944 1710 w (put poly{)1 486 1 1512 1820 t (c1 =\(1,1\); r1 = \(1,0\); ta=-1; tb=-1.4;)6 2052 1 1944 1930 t (left '$--++$' at p4-\(0,0.5\);)3 1512 1 1944 2040 t (right '\(e\)' at c1-\(0.7,1.2\);)3 1512 1 1944 2150 t (};)1944 2260 w (put poly{)1 486 1 1512 2370 t (c1 =\(3.5,1\); r1 = \(1,0\); ta=0.2; tb=-0.2;)6 2214 1 1944 2480 t (left '$----$' at p1+0.2;)3 1296 1 1944 2590 t (right '\(f\)' at c1-\(0.7,1.2\);)3 1512 1 1944 2700 t (};)1944 2810 w (})1080 2920 w 10 PB f (10. Acknowledgements)1 1085 1 720 3220 t 10 PA f ( manual and criticized constructively: Al Aho,)6 2162(My thanks to all who read drafts of this)8 1908 2 970 3376 t ( Grosse, Steve Johnson, Brian Kernighan, John Mashey, Doug McIlroy, and)10 3386(Lorinda Cherry, Eric)2 934 2 720 3496 t ( early users of)3 645(Theo Pavlidis; and to)3 959 2 720 3616 t 8 PA f (IDEAL)2358 3616 w 10 PA f (, especially Eric Grosse, Theo Pavlidis, Norm Schryer,)7 2433 1 2607 3616 t (and Peter Weinberger.)2 995 1 720 3736 t ( E. Lesk,)2 368(2. M.)1 370 2 720 3928 t 10 PI f (Tbl\320a program to format tables,)4 1320 1 1483 3928 t 10 PA f (Bell Laboratories, Murray Hill, New Jersey \(1976\).)6 2208 1 2828 3928 t ( F. Ossanna,)2 545(3. Joseph)1 546 2 720 4084 t 10 PI f (N)1841 4084 w 8 PI f (ROFF)1919 4084 w 10 PI f (/T)2125 4084 w 8 PI f (ROFF)2216 4084 w 10 PI f (User's Manual,)1 639 1 2452 4084 t 10 PA f ( New Jersey)2 543(Bell Laboratories, Murray Hill,)3 1376 2 3121 4084 t (\(1976\).)970 4204 w cleartomark showpage saveobj restore %%EndPage: 25 27 %%Trailer done %%Pages: 27 %%DocumentFonts: Courier Palatino-Roman Palatino-Bold Palatino-Italic Times-Roman Symbol Helvetica-Bold