%! /e 2.71828 def /pi 3.141593 def % z = [x y] -> e^z + z /expn { 1 dict begin aload pop /y exch def /x exch def [ e x exp y 180 mul pi div cos mul x add e x exp y 180 mul pi div sin mul y add ] end } def % x y -> df/dx /dfdy { 1 dict begin aload pop /y exch def /x exch def [ e x exp y 180 mul pi div sin neg mul e x exp y 180 mul pi div cos mul 1 add ] end } def /dfdx { 1 dict begin aload pop /y exch def /x exch def [ e x exp y 180 mul pi div cos mul 1 add e x exp y 180 mul pi div sin mul ] end } def % ------------------------------------------------------------ 2.25 72 mul 5.5 72 mul translate /S 36 def S dup scale 1 S div setlinewidth /k 3 def /llx k neg def /lly -1 def /urx k def /ury 1 def % 20 x 10 grid /N 10 def /M N k mul def /dx urx llx sub M div def /dy ury lly sub N div def % do vertical paths newpath 0 1 M { /i exch def % line at x = llx + dx*i /x llx dx i mul add def /y lly def [x y] expn aload pop /fy exch def /fx exch def % P0 fx fy moveto % calculate df/dy [x y] dfdy aload pop dy mul /dfy exch def dy mul /dfx exch def 1 1 N { /j exch def fx dfx 3 div add fy dfy 3 div add % P1 % calculate next (x, y) /y lly dy j mul add def % calculate next df/dy [x y] dfdy aload pop dy mul /dfy exch def dy mul /dfx exch def [ x y ] expn aload pop /fy exch def /fx exch def fx dfx 3 div sub fy dfy 3 div sub % P2 fx fy curveto % P3 } for } for stroke % do horizontal paths newpath 0 1 N { /j exch def % line at x = llx + dx*i /y lly dy j mul add def /x llx def [x y] expn aload pop /fy exch def /fx exch def % P0 fx fy moveto % calculate df/dx [x y] dfdx aload pop dx mul /dfy exch def dx mul /dfx exch def 1 1 M { /i exch def fx dfx 3 div add fy dfy 3 div add % P1 % calculate next (x, y) /x llx dx i mul add def % calculate next df/dy [x y] dfdx aload pop dx mul /dfy exch def dx mul /dfx exch def [ x y ] expn aload pop /fy exch def /fx exch def fx dfx 3 div sub fy dfy 3 div sub % P2 fx fy curveto % P3 } for } for stroke