From 3ba11f114f4ad5222bc1cd0615cbc32719e60d32 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Wed, 7 Apr 2021 14:58:54 +0000 Subject: pst-func (7apr21) git-svn-id: svn://tug.org/texlive/trunk@58786 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/tex/generic/pst-func/pst-func.tex | 284 ++++++++++++++++++++- 1 file changed, 277 insertions(+), 7 deletions(-) (limited to 'Master/texmf-dist/tex/generic/pst-func') diff --git a/Master/texmf-dist/tex/generic/pst-func/pst-func.tex b/Master/texmf-dist/tex/generic/pst-func/pst-func.tex index c581b1e49f1..abd00a74c16 100644 --- a/Master/texmf-dist/tex/generic/pst-func/pst-func.tex +++ b/Master/texmf-dist/tex/generic/pst-func/pst-func.tex @@ -31,8 +31,8 @@ % interface to the `xkeyval' package \pst@addfams{pst-func} % -\def\fileversion{0.95} -\def\filedate{2020/06/06} +\def\fileversion{0.96} +\def\filedate{2021/04/05} \message{`PST-func' v\fileversion, \filedate\space (hv)} % \pstheader{pst-func.pro} @@ -270,9 +270,10 @@ % \define@key[psset]{pst-func}{n}[1]{\def\psk@func@n{#1 }} \psset[pst-func]{n=0} -\def\psLaguerre{\@ifnextchar[{\psLaguerre@i}{\psLaguerre@i[]}}%% hv 20200111 +% +\def\psLaguerre{\@ifnextchar[\psLaguerre@i{\psLaguerre@i[]}}%% hv 20200111 \def\psLaguerre@i[#1](#2,#3){{%%% n - \pst@killglue% + \pst@killglue \psplot[#1]{#2}{#3}{% /L_n 1 def 0 1 \psk@func@n { @@ -287,6 +288,274 @@ }% }\ignorespaces} % +\def\psLaguerreC{\pst@object{psLaguerreC}}%% hv 20200612 +\def\psLaguerreC@i(#1,#2)(#3,#4){{%%% n (xMin,xMax)(yMin,yMax) + \pst@killglue + \begin@SpecialObj + \addto@pscode{% +% 20 dict begin + /yC #3 def + /dx #2 #1 sub \psk@plotpoints div def + /dy #4 #3 sub \psk@plotpoints div def + /L_i { + 5 userdict begin + /X ED + /n_i ED + /L_n 0 def + 0 1 n_i { + /k_i ED + -1 k_i exp k_i factorial div + n_i k_i MoverN mul + X k_i exp mul L_n add + /L_n ED + } for + L_n % return L_n(x) + end + } def + /n \psk@func@n def + [ % start array of x/y values + \psk@plotpoints { /xC #1 def \psk@plotpoints { + /Re 0 def + 0 1 \psk@func@n 2 div floor { + /j ED % loop index + /j2 j dup add def % 2j + n j2 sub xC L_i % calculate L_{n-2j}(x) + j2 exp % L_{n-2j}^{2j}(x) + -1 j exp yC j2 exp mul % (-1^j)*y^(2j) + j2 factorial % (2*j)! + div + mul + Re add /Re ED + } for + /Im 0 def + 0 1 \psk@func@n 1 sub 2 div floor { + /j ED % loop index + /j2 j dup add def % 2j + n j2 sub 1 sub xC L_i % calculate L_{n-2j-1}(x) + j2 1 add exp % L_{n-2j}^{2j+1}(x) + -1 j 1 sub exp yC j2 1 add exp mul % (-1^j)*y^(2j+1) + j2 1 add factorial % (2*j+1)! + div + mul + Im add /Im ED + } for + Re Im 2 copy \tx@ScreenCoor +% Re Im dup mul exch dup mul add sqrt dup 4 gt {pop 4} if 4 div setgray +% xC yC \tx@ScreenCoor 0 360 2 arc gsave fill stroke grestore + xC dx add /xC ED + } repeat + yC dy add /yC ED + } repeat + false \tx@NArray + \psk@dotsize + \@nameuse{psds@\psk@dotstyle} + \tx@setStrokeTransparency + newpath + n { transform floor .5 add exch floor .5 add exch itransform Dot } repeat +%% end + }% + \end@SpecialObj +}\ignorespaces} +% + +\def\psLaguerreCC{\pst@object{psLaguerreCC}}%% hv 20200612 +\def\psLaguerreCC@i(#1,#2)(#3,#4){{%%% n (xMin,xMax)(yMin,yMax) + \pst@killglue + \begin@SpecialObj + \addto@pscode{% +% 20 dict begin +gsave + /yC #3 def + /dx #2 #1 sub \psk@plotpoints div def + /dy #4 #3 sub \psk@plotpoints div def + /n \psk@func@n def + [ % start array of x/y values + \psk@plotpoints { /xC #1 def \psk@plotpoints { +/z [xC yC ] def +/L0 [1 0] def +/L1 [1 z {-1 mul} forall 3 1 roll add exch] def +n 1 le { + n 0 eq {/L1 L0 def} if + n 1 eq {/L1 L1 def} if + }{ +/m 1 def +n 1 sub + { + /L2 1 m 1 add div + [2 m mul 1 add z {-1 mul} forall 3 1 roll add exch] L1 cxmul + L0 m neg cxrmul cxadd + exch cxrmul def + /L0 L1 def + /L1 L2 def +/m m 1 add def +} repeat +} ifelse +L1 aload pop \tx@ScreenCoor + xC dx add /xC ED + } repeat + yC dy add /yC ED + } repeat + false \tx@NArray + \psk@dotsize + \@nameuse{psds@\psk@dotstyle} + \tx@setStrokeTransparency + newpath + n { transform floor .5 add exch floor .5 add exch itransform Dot } repeat +grestore +%% end + }% + \end@SpecialObj +}\ignorespaces} +% + +\def\psLaguerreCCC{\pst@object{psLaguerreCCC}}%% hv 20200612 +\def\psLaguerreCCC@i(#1,#2)(#3,#4){{%%% n (xMin,xMax)(yMin,yMax) + \pst@killglue + \begin@SpecialObj + \addto@pscode{% +% 20 dict begin + /yC #3 def + /dx #2 #1 sub \psk@plotpoints div def + /dy #4 #3 sub \psk@plotpoints div def + [ % start array of x/y values + \psk@plotpoints { + /xC #1 def + \psk@plotpoints { + /Z [xC yC] def + /L [1 0] def + 0 1 \psk@func@n { + /k ED + \psk@func@n k MoverN -1 k exp k factorial div mul + Z k + tx@FuncDict begin cxexp exch + cxrmul L cxadd end /L ED + } for + L aload pop \tx@ScreenCoor + xC dx add /xC ED + } repeat + yC dy add /yC ED + } repeat +% ] aload length 3 1 roll moveto 2 div cvi 1 sub { lineto } repeat 1 0 0 setrgbcolor 0.1 setlinewidth stroke + false \tx@NArray + \psk@dotsize + \@nameuse{psds@\psk@dotstyle} + \tx@setStrokeTransparency + newpath + n { transform floor .5 add exch floor .5 add exch itransform Dot } repeat +%% end + }% + \end@SpecialObj +}\ignorespaces} +% +\def\psLaguerreCCCC{\pst@object{psLaguerreCCCC}}%% hv 20200612 +\def\psLaguerreCCCC@i(#1,#2)(#3,#4){{%%% n (xMin,xMax)(yMin,yMax) + \pst@killglue + \begin@SpecialObj + \addto@pscode{% +% 20 dict begin + /yC #3 def + /dx #2 #1 sub \psk@plotpoints div def + /dy #4 #3 sub \psk@plotpoints div def + % start array of x/y values + \psk@plotpoints { + /xC #1 def + [ + \psk@plotpoints { + /Z [xC yC] def + /L [1 0] def + 0 1 \psk@func@n { + /k ED + \psk@func@n k MoverN -1 k exp k factorial div mul + Z k + tx@FuncDict begin cxexp exch + cxrmul L cxadd end /L ED + } for + L aload pop \tx@ScreenCoor + xC dx add /xC ED + } repeat + ] + aload length 3 1 roll moveto 2 div cvi 1 sub { lineto } repeat 1 0 0 setrgbcolor 0.1 setlinewidth stroke + yC dy add /yC ED + } repeat +% ] aload length 3 1 roll moveto 2 div cvi 1 sub { lineto } repeat 1 0 0 setrgbcolor 0.1 setlinewidth stroke +% false \tx@NArray +% \psk@dotsize +% \@nameuse{psds@\psk@dotstyle} +% \tx@setStrokeTransparency +% newpath +% n { transform floor .5 add exch floor .5 add exch itransform Dot } repeat +%% end + }% + \end@SpecialObj +}\ignorespaces} +% +\def\psContourLaguerre{\pst@object{psContourLaguerre}}%% hv 20200612 +\def\psContourLaguerre@i(#1,#2)(#3,#4){{%%% n (xMin,xMax)(yMin,yMax) + \pst@killglue + \begin@SpecialObj + \addto@pscode{% + /yC #3 def + /dx #2 #1 sub \psk@plotpoints div def + /dy #4 #3 sub \psk@plotpoints div def + /contourdata [ % start array of x/y values + \psk@plotpoints { + /xC #1 def + [ + \psk@plotpoints { + /Z [xC yC] def + /L [1 0] def + 0 1 \psk@func@n { + /k ED + \psk@func@n k MoverN -1 k exp k factorial div mul + Z k + tx@FuncDict begin cxexp exch + cxrmul L cxadd end /L ED + } for +% L aload cxnorm exch pop + xC yC L cxre exch pop + xC dx add /xC ED + } repeat + ] + yC dy add /yC ED + } repeat + ] def + /zMax 0 def /zMin 0 def % lowest and highest value + contourdata aload length /N ED % get the no of arrays + N { % inside contourdata + /data ED % save first inner array + data aload length 3 div round cvi { % get the records + \psk@colorOffset + dup zMin lt % z