%! /S 72 def S dup scale 1 S div setlinewidth 4 5 translate /PI 3.1415926536 def % t -> [[x(t) y(t)] [x'(t) y'(t)]] % x(t) = r cos(t), y = r sin(t), r = (cos^n + sin^n)^{-1/n} % t in radians /f { 1 dict begin 180 mul PI div /t exch def /c t cos def /s t sin def /c' s neg def /s' c def /r c n exp s n exp add -1 n div exp def /r' c s mul c n 2 sub exp s n 2 sub exp sub mul r n exp mul def [ [ r c mul r s mul ] [ r c' mul r' c mul add r s' mul r' s mul add ] ] end } def % t0 t1 /f /fcurve { load 1 dict begin /f exch def /t1 exch def /t0 exch def /dt t1 t0 sub 3 div def /F0 t0 f def F0 /F1 t1 f def F1 F0 0 get 0 get % x0 F0 1 get 0 get % v0 dt mul add % x1 F0 0 get 1 get F0 1 get 1 get dt mul add F1 0 get 0 get F1 1 get 0 get dt mul sub F1 0 get 1 get F1 1 get 1 get dt mul sub F1 0 get 0 get F1 0 get 1 get curveto end } def /n 4 def /N 8 def /X 2 PI mul N div def newpath 0 f 0 get aload pop moveto 0 1 N 1 sub { /i exch def i X mul i 1 add X mul /f fcurve } for stroke