%!PS-Adobe-2.0 % % basic macros -------------------------------------------------------- /BD {bind def} bind def /cm {2.54 div 72 mul} BD /SL {setlinewidth} BD /SRGB {setrgbcolor} BD /M {moveto} BD /RM {rmoveto} BD /L {lineto} BD /RL {rlineto} BD /GS {gsave } BD /GR {grestore} BD /CPT {currentpoint T} BD % % auxiliary font macros ----------------------------------------------- /E {exch} BD /FFSFSF {E findfont E scalefont setfont} BD /FTB {/Times-Bold 32 FFSFSF} BD % % additional macros --------------------------------------------------- /TC {true charpath} BD /F {fill} BD /S {stroke} BD /D {def} BD /T {translate} BD /Sk {scale} BD /CP {closepath} BD /Ori {0 0 M} BD /OrR {Ori rotate} BD % % lut macros ---------------------------------------------------------- /lut2 { [1 0.5 0 1 0.6 0 1 0.75 0 1 0.8 0 1 1 0 0.8 0.9 0 0.7 0.9 0 0.6 0.9 0 0.5 1 0 0.25 1 0 0 1 0 0 1 0.5 0 1 1 0 0.7 1 0 0.5 1 0 0.2 1 0 0 1 0.2 0 1 0.5 0 1 0.7 0 1 1 0 1 1 0 0.5 1 0 0 0 0 0 ] } D /P2 { 3 mul lut2 exch 3 getinterval aload pop SRGB } BD % % peculiar macros ----------------------------------------------------- % radius Delta nside multistar % nside = number of sides of polygon % Delta = 1 ... n/2 number of jumps (1 polygon, 2 not so pointed star, n/2 spiky) % radius in cm /multistar { /nside E D /Delta E D cm /rad E D % reserve space for arrays /theta nside array def /X nside array def /Y nside array def % arrays indexed 0..n-1 ... fill them 0 1 nside 1 sub {/i E D theta i 360 nside div i mul put } for 0 1 nside 1 sub {/i E D X i theta i get cos put } for 0 1 nside 1 sub {/i E D Y i theta i get sin put } for % XY indexed 1..n /XY {1 sub /i E D X i get rad mul Y i get rad mul} BD 1 /j E D -1 /jold E D 0 /K E D 1 /TEST E D newpath 1 1 nside 1 add { /i E D i 1 sub Delta mul nside mod 1 add K add /j E D i 1 eq {j XY M} {j XY L} ifelse jold j gt j TEST eq and i nside 1 add ne and {j 1 add /TEST E D K 1 add /K E D TEST XY M } {} ifelse j /jold E D } for fill } BD /multibug {str cvs show ( ) show str cvs show ( ) show str cvs show} BD % mulfac Radius delta mside multirota % as multistar but rotated by mulfac at each step in a loop changing the LUT /multirota { /mside E D /delta E D /Rad E D /mulfac E D 0 1 23 { /inx E D inx P2 0 0 M GS CPT inx mulfac mul rotate 23 inx sub 900 div Rad mul delta mside multistar GR } for } BD % body ------------------------------------------------------------------------------------- 3.5 cm 5 cm T 7 cm 10 cm M 10 3.2 cm 2 5 GS CPT multirota GR 7 cm 15 cm M 25 3.2 cm 2 5 GS CPT multirota GR 12 cm 15 cm M 24 3.2 cm 2 5 GS CPT multirota GR 2 cm 15 cm M 26 3.2 cm 2 5 GS CPT multirota GR 7 cm 20 cm M 50 3.2 cm 2 5 GS CPT multirota GR 7 cm 5 cm M 5 3.2 cm 2 5 GS CPT multirota GR 7 cm 0 cm M 1 3.2 cm 2 5 GS CPT multirota GR showpage 3.5 cm 5 cm T 7 cm 10 cm M 25 3.2 cm 4 11 GS CPT multirota GR 7 cm 15 cm M 25 3.2 cm 7 15 GS CPT multirota GR 12 cm 15 cm M 24 3.2 cm 7 15 GS CPT multirota GR 2 cm 15 cm M 26 3.2 cm 7 15 GS CPT multirota GR 7 cm 20 cm M 50 3.2 cm 8 17 GS CPT multirota GR 7 cm 5 cm M 5 3.2 cm 10 27 GS CPT multirota GR 7 cm 0 cm M 1 3.2 cm 17 37 GS CPT multirota GR showpage