%! % an animated rotating yin-yang fractal % rehmi and don, last touched Sat Jun 25 16:50:25 PDT 1988 % depends on don's animator.ps /flipped false def %/yincolor 0 0 .7 hsbcolor def %/yangcolor 0 0 .1 hsbcolor def %/bgcolor .5 .2 .7 hsbcolor def /yincolor { 1 setgray } def /yangcolor { 0 setgray } def /bgcolor .5 def %/step ($1) dup length 0 ne {cvi} {pop 10} ifelse def %/depth ($2) dup length 0 ne {cvi} {pop 4} ifelse def /harmonics [1 1 1 1 1] ?def /depth harmonics length def /rot 0 def /yum { 0 0 1 90 270 arc 0 -.5 .5 270 90 arcn 0 .5 .5 270 90 arc closepath fill } def /yinyang { gsave flipped {yangcolor} {yincolor} ifelse yum 180 rotate flipped {yincolor} {yangcolor} ifelse yum grestore } def /recur { dup 1 ge { gsave harmonics length 1 index sub harmonics exch get rot mul rotate 1 sub yinyang gsave .25 .25 scale 0 3 translate recur 0 -2 translate 180 rotate recur 0 2 translate recur 0 2 translate 180 rotate recur grestore 1 add grestore } if pause } def