%!PS % Smoothbez pissing around with disk gonzo % ======================================= % by Don Lancaster v2.1 October 2016 % don@tinaja.com 928 428 4073 http://www.tinaja.com % copyright 2016 All commercial rights reserved. % Finding the Bezier equivalent for smoothstep % =================================================================== % Gonzo utilities of http://www.tinaja.com/gonzo.psl are presently NOT built in % for immediate use. This adds 90K to the file size. A tutorial is found at % http://www.tinaja.com/glib/gonzotut.pdf % Gonzo itself sourcecode is found at http://www.tinaja.com/gonzo.psl % If, instead, Gonzo is to be run as a diskfile for the much shorter code here, % Distiller MUST be run from the command line as % "C:\Program Files (x86)/Adobe/Acrobat 11.0/Acrobat/acrodist.exe" /F run % Uncomment and suitably modify to use disk based Gonzo. ( or for other disk access ) (C:\\Users\\Don\\Desktop\\Ghost\\gonzo.psl) run % use internal % =================================================================== 100 200 10 setgrid 20 20 showgrid /drawbez { 0 0 mt xval 0 1 xval sub 1 1 1 curveto 0 setlinewidth stroke } store /smooth { sval sval dup mul 3 mul sval dup mul sval mul 2 mul sub % 2 copy == == lineto } store /smoother { sval % 6x^{5}-15x^{4}+10x^{3}} sval 5 exp 6 mul sval 4 exp 15 mul sub sval 3 exp 10 mul add lineto } store %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % {\displaystyle f(x)=-20x^{7}+70x^{6}-84x^{5}+35x^{4}} /smoother7 { sval sval 7 exp -20 mul sval 6 exp 70 mul add sval 5 exp -84 mul add sval 4 exp 35 mul add lineto } store %%%%%%%%%%%%%%%%%%%%%%%%%%%% % { {S} _{5}(x)=70x^{9}-315x^{8}+540x^{7}-420x^{6}+126x^{5}} /smoother9 { sval sval 9 exp 70 mul sval 8 exp -315 mul add sval 7 exp 540 mul add sval 6 exp -420 mul add sval 5 exp 126 mul add lineto } store %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0.002 setlinewidth 255 0 0 setrgbcolor gsave 20 20 scale 0 0 mt 0 0.01 1.0 { /sval exch store smooth} for stroke grestore %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0.002 setlinewidth 100 255 100 setrgbcolor 0 255 0 setrgbcolor gsave 20 20 scale 0 0 mt 0 0.01 1.0 { /sval exch store smoother} for stroke grestore %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0.002 setlinewidth 100 255 100 setrgbcolor 0 255 125 setrgbcolor gsave 20 20 scale 0 0 mt 0 0.01 1.0 { /sval exch store smoother7} for stroke grestore %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0.002 setlinewidth 250 0 130 setrgbcolor gsave 20 20 scale 0 0 mt 0 0.01 1.0 { /sval exch store smoother9} for stroke grestore %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0 setlinewidth 0 0 255 setrgbcolor gsave 20 20 scale 0.333333 /xval exch store drawbez % 0 0.1 0.7 { /xval exch store drawbez} for grestore %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0 setlinewidth 0 0 255 setrgbcolor gsave 20 20 scale 0.5 /xval exch store drawbez % 0 0.1 0.7 { /xval exch store drawbez} for grestore %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0 setlinewidth 0 0 255 setrgbcolor gsave 20 20 scale 0.61 /xval exch store drawbez % 0 0.1 0.7 { /xval exch store drawbez} for grestore %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0 setlinewidth 0 0 255 setrgbcolor gsave 20 20 scale 0.694 /xval exch store drawbez % 0 0.1 0.7 { /xval exch store drawbez} for grestore %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0 setlinewidth 0 0 255 setrgbcolor gsave 20 20 scale 1.0 /xval exch store drawbez % 0 0.1 0.7 { /xval exch store drawbez} for grestore %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 155 255 0 setrgbcolor 0 20 mt 20 0 lineto stroke showpage % EOF