summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2021-04-07 14:58:54 +0000
committerNorbert Preining <preining@logic.at>2021-04-07 14:58:54 +0000
commit3ba11f114f4ad5222bc1cd0615cbc32719e60d32 (patch)
tree5ec998edc5bf7abf3317947c1684c2ece7bf5a69 /Master/texmf-dist/tex/generic
parent7f9381891f4b470e0dbb31e2e0057d6f70a07ae6 (diff)
pst-func (7apr21)
git-svn-id: svn://tug.org/texlive/trunk@58786 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic')
-rw-r--r--Master/texmf-dist/tex/generic/pst-func/pst-func.tex284
1 files changed, 277 insertions, 7 deletions
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<zMin?
+ { /zMin ED } % yes, save it
+ { dup zMax gt { /zMax ED }{ pop } ifelse } ifelse
+ pop pop % delete x y
+ } repeat
+ } repeat
+ clear % clear stack
+ /dz zMax zMin sub def % value range
+ /steps \psk@colSteps\space 0 gt { true }{ false } ifelse def
+ 0 1 N 1 sub { % for i=0 to N-1
+ contourdata exch get /data ED % get first array
+ data aload length 3 div round cvi {
+ \psk@colorOffset
+ /z ED /y ED /x ED
+ z zMin sub dz div % relative z (0..1)
+ \ifPst@colored 400 mul 380 add tx@addDict begin wavelengthToRGB
+ Red Green Blue end setrgbcolor % set color
+ \else
+ steps {\psk@colSteps\space mul round \psk@colSteps\space div} if
+ setgray
+ \fi
+ x \pst@number\psxunit mul y \pst@number\psyunit mul
+ \pst@number\pst@dimb 0 360 arc fill
+ } repeat
+ } for
+ }%
+ \end@SpecialObj
+}\ignorespaces}
+
+
+
\def\psLegendre{\@ifnextchar[{\psLegendre@i}{\psLegendre@i[]}}%% hv 20200115
\def\psLegendre@i[#1](#2,#3){{%%% n
\pst@killglue%
@@ -1459,16 +1728,17 @@
% Superellipese / Lamefunction
\define@key[psset]{pst-func}{radiusA}[1]{\pst@getlength{#1}\pst@radiusA}
\define@key[psset]{pst-func}{radiusB}[1]{\pst@getlength{#1}\pst@radiusB}
-\psset[pst-func]{radiusA=1,radiusB=1}
+\define@key[psset]{pst-func}{endAngle}[0]{\pst@getangle{#1}\psk@endAngle}
+\psset[pst-func]{radiusA=1,radiusB=1,endAngle=0}% startAngle is defined in PSTricks
%
\def\psLame{\pst@object{psLame}}
\def\psLame@i#1{%
\leavevmode
\pst@killglue
\begingroup
- \addbefore@par{plotpoints=200}%
+ \addbefore@par{plotpoints=200,startAngle=0,endAngle=360}%
\use@par
- \parametricplot{0}{360}{%
+ \parametricplot{\psk@startAngle}{\psk@endAngle}{%
t cos dup mul 1 #1\space div exp \pst@radiusA \pst@number\psxunit div mul
t 90 gt { t 270 lt { neg } if } if
t sin dup mul 1 #1\space div exp \pst@radiusB \pst@number\psyunit div mul