%!PS-Adobe-2.0 %%Title: Circles1.ps %%Creator: Will Gilbert %%CreationDate: July 1990, modified July 1997 %%Origin: 0 0 %%BoundingBox: 0 0 440 270 %%EndComments /white {0 0 0 0} def /black {0 0 0 1} def /red {0 1 1 0} def /cyan {1 0 0 0} def /green {1 0 1 0} def /yellow {0 0 1 0} def /ltyellow {0 0 .6 0} def /paleyellow {0 0 .4 0} def /brick {.4 .8 1 0} def /orange {0 .5 1 0} def /lavender {.3 .8 .3 0} def /delta 0.00001 def %underflow /down {/depth depth 1 add def} def /up {/depth depth 1 sub def} def /coldepth {%def Sets color according to depth %stack before: depth colarray length ge {white}{colarray depth get cvx exec} ifelse %stack after: cmykcol } def /fillCircle {%def Fill circle xcenter ycenter radius with color %stack before: cmykcol xcenter ycenter radius 3 copy 0 360 arc gsave 7 3 roll setcmykcolor fill grestore stroke %stack after: xcenter ycenter radius } def /invertPoint {%def Invert point xp yp in circle xc yc rc %stack before: xc yc rc xp yp /yp exch def /xp exch def /rc exch def /yc exch def /xc exch def /xp xp xc sub def /yp yp yc sub def rc dup mul xp dup mul yp dup mul add dup delta lt {pop 1} if %if underflow div dup %rc^2/(xp-xc)^2+(yp-yc)^2 xp mul xc add %xinvpoint exch yp mul yc add %yinvpoint %stack after: xinvpoint yinvpoint } def /invertCircle {%def Invert circle xx yy rr in circle x y r %stack before: x y r xx yy rr /rr exch def /yy exch def /xx exch def /r exch def /y exch def /x exch def rr xx x sub dup mul yy y sub dup mul add sqrt dup delta lt {pop 1} if %if underflow div %rr/sqrt((xx-x)^2+(yy-y)^2) dup xx x sub mul dup xx add /xa exch def xx exch sub /xb exch def yy y sub mul dup yy add /ya exch def yy exch sub /yb exch def x y r xa ya invertPoint /yai exch def /xai exch def x y r xb yb invertPoint /ybi exch def /xbi exch def xai xbi add 2 div %xinvcircle yai ybi add 2 div %yinvcircle xai xbi sub dup mul yai ybi sub dup mul add sqrt 2 div %rinvcircle %stack after: xinvcircle yinvcircle rinvcircle } def /invertOneCircle {%def Recursively inverts each circle in 1 other %Outside circle is x0 y0 r0 %stack before: x0 y0 r0 x1 y1 r1 /r1 exch def /y1 exch def /x1 exch def /r0 exch def /y0 exch def /x0 exch def down x1 y1 r1 coldepth x1 y1 r1 x0 y0 r0 invertCircle fillCircle depth maxdepth 2 sub le {%if invertOneCircle }{%else 6 {pop} repeat %remove 2 circles from stack } ifelse up %stack after: } def /invertThreeCircles {%def Recursively inverts each circle in 3 others %Outside circle is x0 y0 r0 %stack before: x0 y0 r0 x1 y1 r1 x2 y2 r2 x3 y3 r3 /r3 exch def /y3 exch def /x3 exch def /r2 exch def /y2 exch def /x2 exch def /r1 exch def /y1 exch def /x1 exch def /r0 exch def /y0 exch def /x0 exch def down x1 y1 r1 coldepth x1 y1 r1 x0 y0 r0 invertCircle fillCircle coldepth x1 y1 r1 x2 y2 r2 invertCircle fillCircle coldepth x1 y1 r1 x3 y3 r3 invertCircle fillCircle x2 y2 r2 coldepth x2 y2 r2 x0 y0 r0 invertCircle fillCircle coldepth x2 y2 r2 x1 y1 r1 invertCircle fillCircle coldepth x2 y2 r2 x3 y3 r3 invertCircle fillCircle x3 y3 r3 coldepth x3 y3 r3 x0 y0 r0 invertCircle fillCircle coldepth x3 y3 r3 x1 y1 r1 invertCircle fillCircle coldepth x3 y3 r3 x2 y2 r2 invertCircle fillCircle depth maxdepth 2 sub le {%if 3 {invertThreeCircles} repeat }{%else 36 {pop} repeat %remove 12 circles from stack } ifelse up %stack after: } def /invertFourCircles {%def Recursively inverts each circle in 4 others %Outside circle is x0 y0 r0 %stack before: x0 y0 r0 x1 y1 r1 x2 y2 r2 x3 y3 r3 x4 y4 r4 /r4 exch def /y4 exch def /x4 exch def /r3 exch def /y3 exch def /x3 exch def /r2 exch def /y2 exch def /x2 exch def /r1 exch def /y1 exch def /x1 exch def /r0 exch def /y0 exch def /x0 exch def down x1 y1 r1 coldepth x1 y1 r1 x0 y0 r0 invertCircle fillCircle coldepth x1 y1 r1 x2 y2 r2 invertCircle fillCircle coldepth x1 y1 r1 x3 y3 r3 invertCircle fillCircle coldepth x1 y1 r1 x4 y4 r4 invertCircle fillCircle x2 y2 r2 coldepth x2 y2 r2 x0 y0 r0 invertCircle fillCircle coldepth x2 y2 r2 x1 y1 r1 invertCircle fillCircle coldepth x2 y2 r2 x3 y3 r3 invertCircle fillCircle coldepth x2 y2 r2 x4 y4 r4 invertCircle fillCircle x3 y3 r3 coldepth x3 y3 r3 x0 y0 r0 invertCircle fillCircle coldepth x3 y3 r3 x1 y1 r1 invertCircle fillCircle coldepth x3 y3 r3 x2 y2 r2 invertCircle fillCircle coldepth x3 y3 r3 x4 y4 r4 invertCircle fillCircle x4 y4 r4 coldepth x4 y4 r4 x0 y0 r0 invertCircle fillCircle coldepth x4 y4 r4 x1 y1 r1 invertCircle fillCircle coldepth x4 y4 r4 x2 y2 r2 invertCircle fillCircle coldepth x4 y4 r4 x3 y3 r3 invertCircle fillCircle depth maxdepth 2 sub le {%if 4 {invertFourCircles} repeat }{%else 60 {pop} repeat %remove 20 circles from stack } ifelse up %stack after: } def /invertFiveCircles {%def Recursively inverts each circle in 5 others %Outside circle is x0 y0 r0 %stack before: x0 y0 r0 x1 y1 r1 x2 y2 r2 x3 y3 r3 x4 y4 r4 x5 y5 r5 /r5 exch def /y5 exch def /x5 exch def /r4 exch def /y4 exch def /x4 exch def /r3 exch def /y3 exch def /x3 exch def /r2 exch def /y2 exch def /x2 exch def /r1 exch def /y1 exch def /x1 exch def /r0 exch def /y0 exch def /x0 exch def down x1 y1 r1 coldepth x1 y1 r1 x0 y0 r0 invertCircle fillCircle coldepth x1 y1 r1 x2 y2 r2 invertCircle fillCircle coldepth x1 y1 r1 x3 y3 r3 invertCircle fillCircle coldepth x1 y1 r1 x4 y4 r4 invertCircle fillCircle coldepth x1 y1 r1 x5 y5 r5 invertCircle fillCircle x2 y2 r2 coldepth x2 y2 r2 x0 y0 r0 invertCircle fillCircle coldepth x2 y2 r2 x1 y1 r1 invertCircle fillCircle coldepth x2 y2 r2 x3 y3 r3 invertCircle fillCircle coldepth x2 y2 r2 x4 y4 r4 invertCircle fillCircle coldepth x2 y2 r2 x5 y5 r5 invertCircle fillCircle x3 y3 r3 coldepth x3 y3 r3 x0 y0 r0 invertCircle fillCircle coldepth x3 y3 r3 x1 y1 r1 invertCircle fillCircle coldepth x3 y3 r3 x2 y2 r2 invertCircle fillCircle coldepth x3 y3 r3 x4 y4 r4 invertCircle fillCircle coldepth x3 y3 r3 x5 y5 r5 invertCircle fillCircle x4 y4 r4 coldepth x4 y4 r4 x0 y0 r0 invertCircle fillCircle coldepth x4 y4 r4 x1 y1 r1 invertCircle fillCircle coldepth x4 y4 r4 x2 y2 r2 invertCircle fillCircle coldepth x4 y4 r4 x3 y3 r3 invertCircle fillCircle coldepth x4 y4 r4 x5 y5 r5 invertCircle fillCircle x5 y5 r5 coldepth x5 y5 r5 x0 y0 r0 invertCircle fillCircle coldepth x5 y5 r5 x1 y1 r1 invertCircle fillCircle coldepth x5 y5 r5 x2 y2 r2 invertCircle fillCircle coldepth x5 y5 r5 x3 y3 r3 invertCircle fillCircle coldepth x5 y5 r5 x4 y4 r4 invertCircle fillCircle depth maxdepth 2 sub le {%if 5 {invertFiveCircles} repeat }{%else 90 {pop} repeat %remove 30 circles from stack } ifelse up %stack after: } def %%EndProlog %TwoCircles gsave 0 50 translate 1 1 scale /colarray [/cyan /white /green /white /green /black] def %col shades for fill /maxdepth 6 def %depth of iterations /depth 0 def 1.2 setlinewidth coldepth 100 100 80 fillCircle %outside circle down 1 setlinewidth coldepth 72 110 40 fillCircle %inside circle 1 invertOneCircle grestore %FourCircles gsave 50 0 translate 0.8 0.8 scale /colarray [/yellow /lavender /white /red /white] def %col shades /maxdepth 4 def %depth of iterations /depth 0 def 1.8 setlinewidth coldepth 100 100 80 fillCircle %outside circle down 1 setlinewidth coldepth 120 120 38 fillCircle %inside circle 1 coldepth 60 90 15 fillCircle %inside circle 2 coldepth 95 50 25 fillCircle %inside circle 3 invertThreeCircles grestore %SixCircles gsave 175 0 translate 1.4 1.4 scale /colarray [/brick /ltyellow /orange /paleyellow /red] def %col shades for fill /maxdepth 5 def %depth of iterations /depth 0 def 1.5 setlinewidth coldepth 100 100 80 fillCircle %outside circle down 1 setlinewidth coldepth 138 116.8 38.452 fillCircle %inside circle 1 coldepth 91 89.31 16 fillCircle %inside circle 2 coldepth 70 54 25.08 fillCircle %inside circle 3 coldepth 44.56 90.245 19.2 fillCircle %inside circle 4 coldepth 60.8 134.4 27.846 fillCircle %inside circle 5 invertFiveCircles grestore showpage %%EOF