%!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 % % 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 ----------------------------------------------------- % constants /focus { 6 cm 12.0 cm} BD %focus 4.5 cm /maja E D 3.0 cm /minb E D %major minor axes 1 minb minb mul maja maja mul div sub sqrt /ecc E D %eccentricity maja minb div minb div /coeff E D %C coefficient 1 1 ecc add coeff mul div /r1 E D %r1 of periastron 1 1 ecc sub coeff mul div /r2 E D %r2 of apoastron % macro "point of ellipse at theta" /ellipsept {/theta E D theta cos ecc mul 1 add coeff mul 1 exch div /r E D r theta cos mul r theta sin mul} BD % body ------------------------------------------------------------------------------------- 3.5 cm 5 cm T 0 setgray focus M GS CPT Ori 0 ellipsept M 0 0.5 360 {ellipsept L} for stroke 1 0 0 SRGB Ori 0 ellipsept L 0 0.5 90 {ellipsept L} for fill GR showpage