summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-04-18 21:31:01 +0000
committerKarl Berry <karl@freefriends.org>2017-04-18 21:31:01 +0000
commit684bd5dd12c9a1f9dfdb2093e5250b7e5d8967c2 (patch)
tree7f12713b1dd027ae1a97b3508e1ae69e2690e2e4 /Master/texmf-dist/tex/generic
parent76a768304e5d0d23edc97a9596d9170fb74c8bae (diff)
pst-func (18apr17)
git-svn-id: svn://tug.org/texlive/trunk@43912 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.tex119
1 files changed, 97 insertions, 22 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 3c6d6b4200d..87f2da085d7 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.84}
-\def\filedate{2017/03/11}
+\def\fileversion{0.85}
+\def\filedate{2017/04/18}
\message{`PST-func' v\fileversion, \filedate\space (hv)}
%
\pstheader{pst-func.pro}
@@ -434,7 +434,7 @@
\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
+ \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
@@ -683,7 +683,7 @@ radiusout=2,radiusinL=0,radiusinR=1.5,LineEnding=true,leftEnd=1,rightEnd=2,VLine
{ kOld 0 eq
{ kOld \psFunc@leftEnd sub scx 0 moveto % starting point
\ifPst@LineEnding
- kOld \psFunc@radiusout\pst@number\psxunit div sub scx 0 L stroke
+ kOld \psFunc@radiusout\pst@number\psxunit div sub scx 0 L stroke
kOld scx 0 newpath \psFunc@radiusout 0 360 arc kOld scx 0 \psFunc@radiusinR 360 0 arcn closepath \pst@usecolor\psk@LineEndColorR fill \else
kOld scx 0 L stroke \fi }
{ } ifelse } ifelse
@@ -707,7 +707,7 @@ radiusout=2,radiusinL=0,radiusinR=1.5,LineEnding=true,leftEnd=1,rightEnd=2,VLine
ifelse % recursive definition
\ifPst@markZeros kOld scx F scy L k dx add scx F scy L k dx add scx 0 L kOld 1 add scx 0 L
\else
- kOld scx F scy newpath \psFunc@radiusout 0 360 arc kOld scx F scy \psFunc@radiusinL 360 0 arcn closepath \pst@usecolor\psk@LineEndColorL fill
+ kOld scx F scy newpath \psFunc@radiusout 0 360 arc kOld scx F scy \psFunc@radiusinL 360 0 arcn closepath \pst@usecolor\psk@LineEndColorL fill
kOld \ifPst@LineEnding\psFunc@radiusout\pst@number\psxunit div add \fi
scx F scy moveto
k 1 add
@@ -1526,16 +1526,18 @@ radiusout=2,radiusinL=0,radiusinR=1.5,LineEnding=true,leftEnd=1,rightEnd=2,VLine
\endgroup
\ignorespaces}
%
+\define@boolkey[psset]{pst-func}[Pst@]{xory}[true]{}
+\define@boolkey[psset]{pst-func}[Pst@]{approx}[true]{}
+\define@boolkey[psset]{pst-func}[Pst@]{Framed}[true]{}
\define@boolkey[psset]{pst-func}[Pst@]{Newton}[true]{}
\define@boolkey[psset]{pst-func}[Pst@]{PrintCoord}[true]{}
\define@boolkey[psset]{pst-func}[Pst@]{onlyNode}[true]{}
\define@boolkey[psset]{pst-func}[Pst@]{onlyYVal}[true]{}
\define@boolkey[psset]{pst-func}[Pst@]{originV}[true]{}
-\define@key[psset]{pst-func}{PointName}[]{\def\psk@func@PointName{#1}}
+\define@key[psset]{pst-func}{PointName}[I]{\def\psk@func@PointName{#1}}
\define@key[psset]{pst-func}{ydecimals}[2]{\pst@getint{#1}\psk@ydecimals }
\psset[pst-func]{originV=false,onlyNode=false,ydecimals=2,
- PrintCoord=false,onlyYVal=false,Newton=false,PointName=I,
-}
+ PrintCoord=false,onlyYVal=false,Newton=false,PointName=I,Framed=false,xory=false,approx=true}
%
%--------------------------------------------------------------------
%------------- calculate the value of an intersectionpoint -----------
@@ -1546,7 +1548,7 @@ radiusout=2,radiusinL=0,radiusinR=1.5,LineEnding=true,leftEnd=1,rightEnd=2,VLine
% (#1,#2) Intervall f\"{u}r die Nullstelle, bzw #1 Startwert f\"{u}r Newton, #3 1. Funktion, #4 2. Funktion, #5 Knotenname
\begingroup
\pst@killglue
-% \addbefore@par{fontscale=40,PSfont=Times-Roman}%
+ \addbefore@par{framesep=1pt}%fontscale=40,PSfont=Times-Roman}%
\use@par
\pst@Verb{
/FunctionA
@@ -1583,24 +1585,25 @@ radiusout=2,radiusinL=0,radiusinR=1.5,LineEnding=true,leftEnd=1,rightEnd=2,VLine
F_1 F_M mul 0 ge {/Xinf xM def} {/Xsup xM def} ifelse % F_1 * F_M > 0 (F_1 und F_M haben gleiches VZ) => neuer linker x-Wert = xM2
Xinf Xsup sub abs 1e-6 le {exit} if } loop % Die Schleife endet, wenn die Differenz von linkem und rechtem Wert < 10^-6
\fi
- /x xM def FunctionA /yM exch def % x wird Mittelwert und an dieser Stelle die Funktion berechnet und als yM2 definiert
+ /x xM def FunctionA /yM exch def % x wird Mittelwert und an dieser Stelle die Funktion berechnet und als yM definiert
}%
- \pnode(! xM yM){#5}%
- \addto@pscode{
- \ifPst@onlyNode \else
+\pnode(! xM yM){#5}%
+\addto@pscode{%
+\ifPst@onlyNode\else
/dec \psk@decimals\space def % Anzahl der Dezimahlen f\"{u}r x
/ydec \psk@ydecimals\space def % Anzahl der Dezimalen f\"{u}r y
/symb { /Symbol findfont \psk@fontscale\space scalefont setfont } bind def % Symbolschrift f\"{u}r Klammer und senkrechten Strich
/schrift { \psk@PSfont findfont \psk@fontscale scalefont setfont } bind def % Schrift f\"{u}r die Ergebnisse
- /TiefSchrift { /Symbol findfont \psk@fontscale 1.6 div scalefont setfont } bind def % Schrift f\"{u}r tiefergestellte Buchstaben
+ /TiefSchrift { /Symbol findfont \psk@fontscale 1.8 div scalefont setfont } bind def % Schrift f\"{u}r tiefergestellte Buchstaben
/spdx \psk@fontscale 4 div def % Abstand, der mit der Schriftg\"{o}{\ss}e skaliert ist
/spdy \psk@fontscale 15 div def % Abstand, der mit der Schriftg\"{o}{\ss}e skaliert ist
- /Wert { 10 dec exp mul round 10 dec exp div dec 0 eq {cvi 15 string cvs} {15 string cvs } ifelse % x-Wert runden und als string ablegen
+ /Wert { dec -1 le { /dec 15 def } if 10 dec exp mul round 10 dec exp div dec 0 eq { cvi 15 string cvs } { 15 string cvs } ifelse % x-Wert runden und als string ablegen
\ifPst@comma dot2comma \fi show } def % gegebenenfalls Komma statt Punkt und Ergebnis anzeigen
- /yWert { 10 ydec exp mul round 10 ydec exp div ydec 0 eq {cvi 15 string cvs} {15 string cvs } ifelse % y-Wert runden und als string ablegen
+ /yWert { 10 ydec exp mul round 10 ydec exp div ydec 0 eq { cvi 15 string cvs } { 15 string cvs } ifelse % y-Wert runden und als string ablegen
\ifPst@comma dot2comma \fi show } def % gegebenenfalls Komma statt Punkt und Ergebnis anzeigen
/FunctionA \ifPst@algebraic (#3) tx@AlgToPs begin AlgToPs end cvx \else {#3} \fi def
/FunctionB \ifPst@algebraic (#4) tx@AlgToPs begin AlgToPs end cvx \else {#4} \fi def
+ /frs \pst@number\psframesep def
\ifPst@Newton
/eps 1e-6 def
/x0 #1 def
@@ -1634,17 +1637,89 @@ radiusout=2,radiusinL=0,radiusinR=1.5,LineEnding=true,leftEnd=1,rightEnd=2,VLine
yM \psk@yShift\space add \pst@number\psyunit mul
\fi
\pst@usecolor\pslinecolor
- \ifPst@PrintCoord
- moveto schrift (\psk@func@PointName) show
+ \ifPst@PrintCoord
+/xytext { moveto schrift (\psk@func@PointName) show
0 spdy 2 mul neg rmoveto TiefSchrift (\psk@postString) show
0 spdy 3 mul rmoveto symb (\string\050) show
0 spdy neg rmoveto schrift xM Wert
spdx 3 div spdy rmoveto symb (\string\174) show
- spdx 3 div spdy neg rmoveto yM yWert 0 spdy rmoveto symb (\string\051) show
+ spdx 3 div spdy neg rmoveto schrift yM yWert 0 spdy rmoveto symb (\string\051) show } bind def
+ xytext
+ 0 spdy neg rmoveto
+% ------------------------------------------------------------------------------ TS 03.2017
+ \ifPst@Framed
+ frs \psk@fontscale 0.15 mul frs add neg rmoveto
+ 0 \psk@fontscale 0.9 mul frs 2 mul add rlineto
+ \ifPst@originV
+ frs neg \psk@fontscale 0.75 mul frs add L
+ \else
+ xM \psk@xShift\space add \pst@number\psxunit mul frs sub
+ yM \psk@yShift\space add \pst@number\psyunit mul \psk@fontscale 0.75 mul add frs add L
+ \fi
+ 0 \psk@fontscale 0.9 mul frs 2 mul add neg rlineto closepath
+ gsave
+ \pst@usecolor\psfillcolor \tx@setTransparency fill
+ grestore
+ \ifx\pslinestyle\@none\else
+ \pst@number\pslinewidth SLW \pst@usecolor\pslinecolor \tx@setStrokeTransparency \@nameuse{psls@\pslinestyle} stroke
+ \fi
+ \ifPst@originV 0 0 \else
+ xM \psk@xShift\space add \pst@number\psxunit mul
+ yM \psk@yShift\space add \pst@number\psyunit mul
+ \fi
+ xytext
+ 0 spdy neg rmoveto
+ \fi
+%------------------------------ Wenn nicht die Form P(a|b) sondern x = a oder y = b oder nur a oder nur b -------------------
\else
- \ifPst@onlyYVal moveto schrift yM yWert \else moveto schrift xM Wert \fi
- \fi\fi}%
- \ifPst@markZeros \psdot(#5)\fi
+ \ifPst@originV 0 0 \else
+ xM \psk@xShift\space add \pst@number\psxunit mul
+ yM \psk@yShift\space add \pst@number\psyunit mul
+ \fi
+ /xorytext { moveto schrift
+ \ifPst@onlyYVal% nur der y-Wert
+ \ifPst@xory% in Form von y=b
+ (\psk@func@PointName) show
+ spdx 5 div neg spdy 2.2 mul neg rmoveto TiefSchrift (\psk@postString) show
+ spdx 1.5 div spdy 2 mul rmoveto symb(\ifPst@approx \string \273 \else \string = \fi) show
+ spdx 1.5 div neg 0 rmoveto schrift yM yWert
+ \else schrift yM yWert
+ \fi
+ \else
+ \ifPst@xory% in Form x = a
+ (\psk@func@PointName) show
+ spdx 7 div neg spdy 2.2 mul neg rmoveto TiefSchrift (\psk@postString) show
+ spdx 1.5 div spdy 2 mul rmoveto symb (\ifPst@approx \string \273 \else \string = \fi) show
+ spdx 1.5 div neg 0 rmoveto schrift xM Wert
+ \else schrift xM Wert
+ \fi
+ \fi } bind def
+ xorytext
+ \ifPst@Framed%------------------------------ Rahmenbeginn ------------------------------
+ frs \psk@fontscale 0.14 mul frs add neg rmoveto
+ 0 \psk@fontscale 0.9 mul frs 2 mul add rlineto
+ \ifPst@originV
+ frs neg \psk@fontscale 0.75 mul frs add L
+ \else
+ xM \psk@xShift\space add \pst@number\psxunit mul frs sub
+ yM \psk@yShift\space add \pst@number\psyunit mul \psk@fontscale 0.75 mul add frs add L
+ \fi
+ 0 \psk@fontscale 0.9 mul frs 2 mul add neg rlineto closepath
+ gsave
+ \pst@usecolor\psfillcolor \tx@setTransparency fill
+ grestore
+ \ifx\pslinestyle\@none\else
+ \pst@number\pslinewidth SLW \pst@usecolor\pslinecolor \tx@setStrokeTransparency \@nameuse{psls@\pslinestyle} stroke
+ \fi
+ \ifPst@originV 0 0 \else
+ xM \psk@xShift\space add \pst@number\psxunit mul
+ yM \psk@yShift\space add \pst@number\psyunit mul
+ \fi
+ xorytext
+ \fi
+ \fi
+\fi}%
+\ifPst@markZeros\psdot(#5)\fi
\endgroup\use@pscode\ignorespaces
}%
%