summaryrefslogtreecommitdiff
path: root/graphics/pstricks
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-04-07 03:01:59 +0000
committerNorbert Preining <norbert@preining.info>2021-04-07 03:01:59 +0000
commit70fe7f94e8281b0691a51754da3e2d40b1dd7732 (patch)
treef4be4cdf15aa796af9ae46eaf33d24279659cdb9 /graphics/pstricks
parente4d1c68b2517d031bb9adc055fe19d1051c81042 (diff)
CTAN sync 202104070301
Diffstat (limited to 'graphics/pstricks')
-rw-r--r--graphics/pstricks/contrib/pst-func/Changes3
-rw-r--r--graphics/pstricks/contrib/pst-func/doc/pst-func-doc.pdfbin3889616 -> 4036896 bytes
-rw-r--r--graphics/pstricks/contrib/pst-func/dvips/pst-func.pro16
-rw-r--r--graphics/pstricks/contrib/pst-func/tex/pst-func.tex284
4 files changed, 293 insertions, 10 deletions
diff --git a/graphics/pstricks/contrib/pst-func/Changes b/graphics/pstricks/contrib/pst-func/Changes
index 32534e1f7f..1aadfbe9be 100644
--- a/graphics/pstricks/contrib/pst-func/Changes
+++ b/graphics/pstricks/contrib/pst-func/Changes
@@ -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
diff --git a/graphics/pstricks/contrib/pst-func/doc/pst-func-doc.pdf b/graphics/pstricks/contrib/pst-func/doc/pst-func-doc.pdf
index 740e2568d6..12ee728910 100644
--- a/graphics/pstricks/contrib/pst-func/doc/pst-func-doc.pdf
+++ b/graphics/pstricks/contrib/pst-func/doc/pst-func-doc.pdf
Binary files differ
diff --git a/graphics/pstricks/contrib/pst-func/dvips/pst-func.pro b/graphics/pstricks/contrib/pst-func/dvips/pst-func.pro
index 1eca86df51..09252c19a3 100644
--- a/graphics/pstricks/contrib/pst-func/dvips/pst-func.pro
+++ b/graphics/pstricks/contrib/pst-func/dvips/pst-func.pro
@@ -366,10 +366,11 @@ tx@FuncDict begin
} 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 @@ tx@FuncDict begin
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
+%
diff --git a/graphics/pstricks/contrib/pst-func/tex/pst-func.tex b/graphics/pstricks/contrib/pst-func/tex/pst-func.tex
index c581b1e49f..abd00a74c1 100644
--- a/graphics/pstricks/contrib/pst-func/tex/pst-func.tex
+++ b/graphics/pstricks/contrib/pst-func/tex/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