texlive[58786] Master/texmf-dist: pst-func (7apr21)
commits+preining at tug.org
commits+preining at tug.org
Wed Apr 7 16:58:54 CEST 2021
Revision: 58786
http://tug.org/svn/texlive?view=revision&revision=58786
Author: preining
Date: 2021-04-07 16:58:54 +0200 (Wed, 07 Apr 2021)
Log Message:
-----------
pst-func (7apr21)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/generic/pst-func/Changes
trunk/Master/texmf-dist/doc/generic/pst-func/pst-func-doc.pdf
trunk/Master/texmf-dist/dvips/pst-func/pst-func.pro
trunk/Master/texmf-dist/tex/generic/pst-func/pst-func.tex
Modified: trunk/Master/texmf-dist/doc/generic/pst-func/Changes
===================================================================
--- trunk/Master/texmf-dist/doc/generic/pst-func/Changes 2021-04-07 07:55:34 UTC (rev 58785)
+++ trunk/Master/texmf-dist/doc/generic/pst-func/Changes 2021-04-07 14:58:54 UTC (rev 58786)
@@ -1,5 +1,6 @@
..... pst-func.tex
-0.95 2020-06-06 - another two more polynomial functions
+0.96 2021-04-06 - added start/endAngle for \psLame
+0.95 2020-06-07 - another two more polynomial functions
0.94 2020-01-01 - small fixes
0.93 2019-05-17 - fix for missing end in a local dictionary (\psBinomialX)
0.92 2018-12-13 - allow algebraic mode for \pscumIntegral
Modified: trunk/Master/texmf-dist/doc/generic/pst-func/pst-func-doc.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/dvips/pst-func/pst-func.pro
===================================================================
--- trunk/Master/texmf-dist/dvips/pst-func/pst-func.pro 2021-04-07 07:55:34 UTC (rev 58785)
+++ trunk/Master/texmf-dist/dvips/pst-func/pst-func.pro 2021-04-07 14:58:54 UTC (rev 58786)
@@ -366,10 +366,11 @@
} def
%end{vasicek density}
%
-
+end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% subroutines for complex numbers, given as an array [a b]
% which is a+bi = Real+i Imag
+%% Global defined
%
/cxadd { % [a1 b1] [a2 b2] = [a1+a2 b1+b2]
dup 0 get % [a1 b1] [a2 b2] a2
@@ -504,4 +505,15 @@
RadtoDeg dup sin exch cos cxmake2
} def
%
-end
+% cxexp z^k with k as a natural number
+/cxexp { % z k
+ 3 dict begin
+ dup 0 eq { pop pop [1 0] }{
+ /k ED
+ /z ED
+ /sol [1 0] def
+ k { sol z cxmul /sol ED } repeat
+ sol } ifelse
+ end
+} def
+%
Modified: trunk/Master/texmf-dist/tex/generic/pst-func/pst-func.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/pst-func/pst-func.tex 2021-04-07 07:55:34 UTC (rev 58785)
+++ trunk/Master/texmf-dist/tex/generic/pst-func/pst-func.tex 2021-04-07 14:58:54 UTC (rev 58786)
@@ -31,8 +31,8 @@
% interface to the `xkeyval' package
\pst at 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 at key[psset]{pst-func}{n}[1]{\def\psk at func@n{#1 }}
\psset[pst-func]{n=0}
-\def\psLaguerre{\@ifnextchar[{\psLaguerre at i}{\psLaguerre at i[]}}%% hv 20200111
+%
+\def\psLaguerre{\@ifnextchar[\psLaguerre at i{\psLaguerre at i[]}}%% hv 20200111
\def\psLaguerre at i[#1](#2,#3){{%%% n
- \pst at killglue%
+ \pst at killglue
\psplot[#1]{#2}{#3}{%
/L_n 1 def
0 1 \psk at func@n {
@@ -287,6 +288,274 @@
}%
}\ignorespaces}
%
+\def\psLaguerreC{\pst at object{psLaguerreC}}%% hv 20200612
+\def\psLaguerreC at i(#1,#2)(#3,#4){{%%% n (xMin,xMax)(yMin,yMax)
+ \pst at killglue
+ \begin at SpecialObj
+ \addto at pscode{%
+% 20 dict begin
+ /yC #3 def
+ /dx #2 #1 sub \psk at plotpoints div def
+ /dy #4 #3 sub \psk at 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 at func@n def
+ [ % start array of x/y values
+ \psk at plotpoints { /xC #1 def \psk at plotpoints {
+ /Re 0 def
+ 0 1 \psk at 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 at 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 at ScreenCoor
+% Re Im dup mul exch dup mul add sqrt dup 4 gt {pop 4} if 4 div setgray
+% xC yC \tx at ScreenCoor 0 360 2 arc gsave fill stroke grestore
+ xC dx add /xC ED
+ } repeat
+ yC dy add /yC ED
+ } repeat
+ false \tx at NArray
+ \psk at dotsize
+ \@nameuse{psds@\psk at dotstyle}
+ \tx at setStrokeTransparency
+ newpath
+ n { transform floor .5 add exch floor .5 add exch itransform Dot } repeat
+%% end
+ }%
+ \end at SpecialObj
+}\ignorespaces}
+%
+
+\def\psLaguerreCC{\pst at object{psLaguerreCC}}%% hv 20200612
+\def\psLaguerreCC at i(#1,#2)(#3,#4){{%%% n (xMin,xMax)(yMin,yMax)
+ \pst at killglue
+ \begin at SpecialObj
+ \addto at pscode{%
+% 20 dict begin
+gsave
+ /yC #3 def
+ /dx #2 #1 sub \psk at plotpoints div def
+ /dy #4 #3 sub \psk at plotpoints div def
+ /n \psk at func@n def
+ [ % start array of x/y values
+ \psk at plotpoints { /xC #1 def \psk at 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 at ScreenCoor
+ xC dx add /xC ED
+ } repeat
+ yC dy add /yC ED
+ } repeat
+ false \tx at NArray
+ \psk at dotsize
+ \@nameuse{psds@\psk at dotstyle}
+ \tx at setStrokeTransparency
+ newpath
+ n { transform floor .5 add exch floor .5 add exch itransform Dot } repeat
+grestore
+%% end
+ }%
+ \end at SpecialObj
+}\ignorespaces}
+%
+
+\def\psLaguerreCCC{\pst at object{psLaguerreCCC}}%% hv 20200612
+\def\psLaguerreCCC at i(#1,#2)(#3,#4){{%%% n (xMin,xMax)(yMin,yMax)
+ \pst at killglue
+ \begin at SpecialObj
+ \addto at pscode{%
+% 20 dict begin
+ /yC #3 def
+ /dx #2 #1 sub \psk at plotpoints div def
+ /dy #4 #3 sub \psk at plotpoints div def
+ [ % start array of x/y values
+ \psk at plotpoints {
+ /xC #1 def
+ \psk at plotpoints {
+ /Z [xC yC] def
+ /L [1 0] def
+ 0 1 \psk at func@n {
+ /k ED
+ \psk at func@n k MoverN -1 k exp k factorial div mul
+ Z k
+ tx at FuncDict begin cxexp exch
+ cxrmul L cxadd end /L ED
+ } for
+ L aload pop \tx at 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 at NArray
+ \psk at dotsize
+ \@nameuse{psds@\psk at dotstyle}
+ \tx at setStrokeTransparency
+ newpath
+ n { transform floor .5 add exch floor .5 add exch itransform Dot } repeat
+%% end
+ }%
+ \end at SpecialObj
+}\ignorespaces}
+%
+\def\psLaguerreCCCC{\pst at object{psLaguerreCCCC}}%% hv 20200612
+\def\psLaguerreCCCC at i(#1,#2)(#3,#4){{%%% n (xMin,xMax)(yMin,yMax)
+ \pst at killglue
+ \begin at SpecialObj
+ \addto at pscode{%
+% 20 dict begin
+ /yC #3 def
+ /dx #2 #1 sub \psk at plotpoints div def
+ /dy #4 #3 sub \psk at plotpoints div def
+ % start array of x/y values
+ \psk at plotpoints {
+ /xC #1 def
+ [
+ \psk at plotpoints {
+ /Z [xC yC] def
+ /L [1 0] def
+ 0 1 \psk at func@n {
+ /k ED
+ \psk at func@n k MoverN -1 k exp k factorial div mul
+ Z k
+ tx at FuncDict begin cxexp exch
+ cxrmul L cxadd end /L ED
+ } for
+ L aload pop \tx at 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 at NArray
+% \psk at dotsize
+% \@nameuse{psds@\psk at dotstyle}
+% \tx at setStrokeTransparency
+% newpath
+% n { transform floor .5 add exch floor .5 add exch itransform Dot } repeat
+%% end
+ }%
+ \end at SpecialObj
+}\ignorespaces}
+%
+\def\psContourLaguerre{\pst at object{psContourLaguerre}}%% hv 20200612
+\def\psContourLaguerre at i(#1,#2)(#3,#4){{%%% n (xMin,xMax)(yMin,yMax)
+ \pst at killglue
+ \begin at SpecialObj
+ \addto at pscode{%
+ /yC #3 def
+ /dx #2 #1 sub \psk at plotpoints div def
+ /dy #4 #3 sub \psk at plotpoints div def
+ /contourdata [ % start array of x/y values
+ \psk at plotpoints {
+ /xC #1 def
+ [
+ \psk at plotpoints {
+ /Z [xC yC] def
+ /L [1 0] def
+ 0 1 \psk at func@n {
+ /k ED
+ \psk at func@n k MoverN -1 k exp k factorial div mul
+ Z k
+ tx at 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 at 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 at 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 at colorOffset
+ /z ED /y ED /x ED
+ z zMin sub dz div % relative z (0..1)
+ \ifPst at colored 400 mul 380 add tx at addDict begin wavelengthToRGB
+ Red Green Blue end setrgbcolor % set color
+ \else
+ steps {\psk at colSteps\space mul round \psk at colSteps\space div} if
+ setgray
+ \fi
+ x \pst at number\psxunit mul y \pst at number\psyunit mul
+ \pst at number\pst at dimb 0 360 arc fill
+ } repeat
+ } for
+ }%
+ \end at SpecialObj
+}\ignorespaces}
+
+
+
\def\psLegendre{\@ifnextchar[{\psLegendre at i}{\psLegendre at i[]}}%% hv 20200115
\def\psLegendre at i[#1](#2,#3){{%%% n
\pst at killglue%
@@ -1459,7 +1728,8 @@
% Superellipese / Lamefunction
\define at key[psset]{pst-func}{radiusA}[1]{\pst at getlength{#1}\pst at radiusA}
\define at key[psset]{pst-func}{radiusB}[1]{\pst at getlength{#1}\pst at radiusB}
-\psset[pst-func]{radiusA=1,radiusB=1}
+\define at key[psset]{pst-func}{endAngle}[0]{\pst at getangle{#1}\psk at endAngle}
+\psset[pst-func]{radiusA=1,radiusB=1,endAngle=0}% startAngle is defined in PSTricks
%
\def\psLame{\pst at object{psLame}}
\def\psLame at i#1{%
@@ -1466,9 +1736,9 @@
\leavevmode
\pst at killglue
\begingroup
- \addbefore at par{plotpoints=200}%
+ \addbefore at par{plotpoints=200,startAngle=0,endAngle=360}%
\use at par
- \parametricplot{0}{360}{%
+ \parametricplot{\psk at startAngle}{\psk at endAngle}{%
t cos dup mul 1 #1\space div exp \pst at radiusA \pst at number\psxunit div mul
t 90 gt { t 270 lt { neg } if } if
t sin dup mul 1 #1\space div exp \pst at radiusB \pst at number\psyunit div mul
More information about the tex-live-commits
mailing list.