%!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 62 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 % % peculiar macros ----------------------------------------------------- /vertex {/ang E D radius 90 ang sub cos mul radius 90 ang sub sin mul} BD /polygon {/n E D /cang 360 n div D GS CPT 0 vertex M cang cang 360 {vertex L} for S GR} BD /polygon2 {/n E D /cang 360 n div D /bang 180 cang sub 2 div D side 2 div neg side 2 div bang cos div bang sin mul neg RM 0 1 n 1 sub {side 0 RL cang rotate} for } BD % body (order matters) --------------------------------------------------------------------- 3.5 cm 5 cm T /nsides 6 D % change this once for all 4 cases /side 3 cm D 1 1 0 SRGB 3 SL 7 cm 10 cm M nsides polygon2 F /radius side 2 div bang cos div D 0 1 0 SRGB 3 SL 7 cm 10 cm M nsides polygon 1 0 0 SRGB /side 4 cm D 2 SL 7 cm 10 cm M nsides polygon2 S 0 0 0 SRGB /radius 4 cm D 1 SL 7 cm 10 cm M nsides polygon % optional, enable to see these are all circumscribed % % 0 0 0 SRGB /radius 4 cm D 1 SL 7 cm 10 cm M 11 polygon % 0 0 0 SRGB /radius 4 cm D 1 SL 7 cm 10 cm M 9 polygon % 0 0 0 SRGB /radius 4 cm D 1 SL 7 cm 10 cm M 7 polygon % 0 0 0 SRGB /radius 4 cm D 1 SL 7 cm 10 cm M 5 polygon % 0 0 0 SRGB /radius 4 cm D 1 SL 7 cm 10 cm M 3 polygon showpage