summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pst-func
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-10-08 22:32:27 +0000
committerKarl Berry <karl@freefriends.org>2009-10-08 22:32:27 +0000
commite41ca94a9a98557cd2d5f67315b50811a6672e3e (patch)
treea6b9d3fb6382245cd9bdceafb735b2976bc47a2c /Master/texmf-dist/tex/generic/pst-func
parent9bc61b9b115e4172c7a751e24511e4a5ce0247a0 (diff)
pst-func 0.60 (8oct09)
git-svn-id: svn://tug.org/texlive/trunk@15699 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/pst-func')
-rw-r--r--Master/texmf-dist/tex/generic/pst-func/pst-func.tex90
1 files changed, 75 insertions, 15 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 c3bbc38e39a..88b322b1c7d 100644
--- a/Master/texmf-dist/tex/generic/pst-func/pst-func.tex
+++ b/Master/texmf-dist/tex/generic/pst-func/pst-func.tex
@@ -1,4 +1,4 @@
-%% $Id: pst-func.tex 72 2009-01-08 22:00:47Z herbert $
+%% $Id: pst-func.tex 137 2009-10-08 18:15:14Z herbert $
%%
%% This is file `pst-func.tex',
%%
@@ -29,8 +29,8 @@
% interface to the `xkeyval' package
\pst@addfams{pst-func}
-\def\fileversion{0.59}
-\def\filedate{2009/01/23}
+\def\fileversion{0.60}
+\def\filedate{2009/10/08}
\message{`PST-func' v\fileversion, \filedate\space (hv)}
%
\pstheader{pst-func.pro}
@@ -53,7 +53,7 @@
\def\psFourier@i[#1]#2#3{{%
\pst@killglue
\psset{#1}
- \psplot{#2}{#3}{%
+ \psplot[algebraic=false]{#2}{#3}{%
/type (cos) def
/Fourier {
aload length /n exch def
@@ -210,7 +210,7 @@
\pst@killglue%
\psset{plotpoints=200}%
\psset{#1}%
- \psplot{#2}{#3}{%
+ \psplot[algebraic=false]{#2}{#3}{%
Euler x \psk@mue sub dup mul 2 div \psk@sigma dup mul div neg exp
1.0 \psk@sigma div TwoPi sqrt div mul%
}%
@@ -323,11 +323,17 @@
\psset[pst-func]{PSfont=Times-Roman,fontscale=10,valuewidth=10,decimals=-1}
%
\def\psPrintValue{\pst@object{psPrintValue}}
-\def\psPrintValue@i#1{%
+\def\psPrintValue@i#1{\expandafter\psPrintValue@ii#1,,\@nil}
+\def\psPrintValue@ii#1,#2,#3\@nil{% #1,#2 only for algebraic code
\begin@SpecialObj
\addto@pscode{
gsave \psk@PSfont findfont \psk@fontscale scalefont setfont
- #1 \psk@decimals -1 gt { 10 \psk@decimals exp dup 3 1 roll mul cvi exch div } if
+ \ifPst@algebraic
+ /x #1 def
+ /Func (#2) tx@AlgToPs begin AlgToPs end cvx def
+ Func
+ \else #1 \fi
+ \psk@decimals -1 gt { 10 \psk@decimals exp dup 3 1 roll mul cvi exch div } if
\psk@valuewidth string cvs /Output exch def % save output
\ifPst@comma % do we have to change dot to comma
0 1 Output length 1 sub {
@@ -339,6 +345,60 @@
}%
\end@SpecialObj%
}
+
+\define@boolkey[psset]{pst-func}[Pst@]{round}[true]{}%
+\define@boolkey[psset]{pst-func}[Pst@]{science}[true]{%
+ \ifPst@science\def\psk@Scin{true }\else\def\psk@Scin{false }\fi}
+\psset[pst-func]{science=false,round=false}
+\def\psPrintValueNew{\pst@object{psPrintValueNew}}
+\def\psPrintValueNew@i#1{\expandafter\psPrintValueNew@ii#1,,\@nil}
+\def\psPrintValueNew@ii#1,#2,#3\@nil{% #1,#2 only for algebraic code
+ \begin@SpecialObj
+ \addto@pscode{ % thanks to Buddy Ledger
+ /mfont { \psk@PSfont findfont \psk@fontscale scalefont setfont } bind def
+ /mfontexp { \psk@PSfont findfont \psk@fontscale 1.2 div scalefont setfont } bind def
+ /s1 { /Symbol findfont \psk@fontscale scalefont setfont } bind def
+ \ifPst@algebraic
+ /x #1 def
+ /Func (#2) tx@AlgToPs begin AlgToPs end cvx def
+ Func
+ \else #1 \fi
+ /value ED
+ \psk@Scin {
+ value 0 ne { value log floor cvi /expon ED }{ /expon 0 def } ifelse
+ value 10 expon exp div
+ \psk@decimals -1 gt { 10 \psk@decimals exp dup 3 1 roll mul
+ \ifPst@round round \else cvi \fi exch div } if
+ \psk@decimals 0 eq { cvi } if /numb ED
+ expon \psk@valuewidth string cvs /expon exch def
+ numb \psk@valuewidth string cvs /Output exch def
+ \ifPst@comma % do we have to change dot to comma
+ 0 1 Output length 1 sub {
+ /Index exch def
+ Output Index get 46 eq { Output Index 44 put } if
+ } for
+ \fi
+ /txspc \psk@fontscale 4 div def
+ \psk@xShift\space 0 moveto mfont Output show
+ txspc 0 rmoveto s1 (\string\264) show
+ txspc 0 rmoveto mfont (10) show
+ txspc 2 div txspc 1.5 mul rmoveto mfontexp expon show }
+ { value
+ \psk@decimals -1 gt { 10 \psk@decimals exp dup 3 1 roll mul
+ \ifPst@round round \else cvi \fi exch div } if
+ \psk@decimals 0 eq { cvi } if %inserted to handle decimals=0
+ \psk@valuewidth string cvs /Output ED
+ \ifPst@comma % do we have to change dot to comma
+ 0 1 Output length 1 sub {
+ /Index exch def
+ Output Index get 46 eq { Output Index 44 put } if
+ } for
+ \fi
+ \psk@xShift\space 0 moveto mfont Output show
+ } ifelse
+ }%
+ \end@SpecialObj%
+}
%
% Integrals 2006-01-16
% Jose-Emilio Vila-Forcen, Herbert Voss
@@ -574,7 +634,7 @@
\else
\addbefore@par{plotpoints=500,alpha=0.5,beta=0.5}%
\begin@OpenObj
- \psplot{#1}{#2}{
+ \psplot[algebraic=false]{#1}{#2}{
\psk@beta x mul \psk@alpha exp x div Euler \psk@beta neg x mul \psk@alpha GAMMALN sub exp mul}
\end@OpenObj%
\fi%
@@ -587,7 +647,7 @@
\else
\addbefore@par{plotpoints=200,alpha=1,beta=1}%
\begin@OpenObj
- \psplot{#1}{#2}{
+ \psplot[algebraic=false]{#1}{#2}{
\psk@beta \psk@alpha add GAMMA
\psk@beta GAMMA \psk@alpha GAMMA mul div
1 x sub \psk@beta 1.0 sub exp mul
@@ -603,7 +663,7 @@
\begin@OpenObj
% \ifdim\psk@nue pt<\z@ \psframebox*{\color{red}!!!nue must be greater than 0!!!}
% \else
- \psplot{#1}{#2}{%
+ \psplot[algebraic=false]{#1}{#2}{%
x 2 div \psk@nue 2 div exp x div Euler -0.5 x mul \psk@nue 2 div GAMMALN sub exp mul }%
% \fi%
\end@OpenObj%
@@ -619,7 +679,7 @@
\use@par
\ifdim\psk@nue pt<\z@ \psframebox*{\color{red}!!!nue must be greater than 0!!!}
\else
- \psplot{#1}{#2}{
+ \psplot[algebraic=false]{#1}{#2}{
1 x 2 exp \psk@nue div 1 add \psk@nue 1 add 2 div exp div
\psk@nue Pi mul sqrt div
Euler \psk@nue 1 add 2 div GAMMALN \psk@nue 2 div GAMMALN sub exp mul
@@ -638,7 +698,7 @@
\begingroup
\addbefore@par{plotpoints=500,mue=1}%
\use@par
- \psplot{#1}{#2}{
+ \psplot[algebraic=false]{#1}{#2}{
x \psk@mue mul \psk@nue div dup \psk@mue 2 div exp x div
exch 1 add \psk@mue \psk@nue add 2 div exp div
Euler \psk@mue \psk@nue add 2 div GAMMALN
@@ -735,8 +795,8 @@
\pst@killglue
\begingroup
\use@par
- \psplot[fillstyle=none]{#1}{#2}{#4}% original function
- \psplot[fillstyle=none]{#1}{#2}{#4 neg}% mirrored at the x-axis
+ \psplot[algebraic=false,fillstyle=none]{#1}{#2}{#4}% original function
+ \psplot[algebraic=false,fillstyle=none]{#1}{#2}{#4 neg}% mirrored at the x-axis
\multido{\iA=1+1}{#3}{% run it #3 times with increment \A
\pscustom{% to get a closed filled ellipse
\code{ % the PS code
@@ -756,7 +816,7 @@
8 div exch)% draw again the ellipse to get the borderline.
\psset{plotstyle=line,linestyle=dashed,
plotpoints=40,dotstyle=*,dotsize=0.5pt}
- \psplot{#1}{#2}{#4}\psplot{#1}{#2}{#4 neg}
+ \psplot[algebraic=false]{#1}{#2}{#4}\psplot{#1}{#2}{#4 neg}
% draw again the curves to get the borderline
\endgroup%
\ignorespaces%