summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pst-plot
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-04-17 00:49:57 +0000
committerKarl Berry <karl@freefriends.org>2011-04-17 00:49:57 +0000
commitb69e4a3602ebc7d4526af84b680cf63ed0cf9021 (patch)
tree2adbfaf6cbdcdb6d9c5231703af2bc633c46ea37 /Master/texmf-dist/tex/generic/pst-plot
parent2e1f9683796eac1430947f795341e3a4abc5de55 (diff)
pst-plot 1.29 (14apr11)
git-svn-id: svn://tug.org/texlive/trunk@22099 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/pst-plot')
-rw-r--r--Master/texmf-dist/tex/generic/pst-plot/pst-plot.tex90
1 files changed, 84 insertions, 6 deletions
diff --git a/Master/texmf-dist/tex/generic/pst-plot/pst-plot.tex b/Master/texmf-dist/tex/generic/pst-plot/pst-plot.tex
index 55c751c7c1f..7e5ef72f8d2 100644
--- a/Master/texmf-dist/tex/generic/pst-plot/pst-plot.tex
+++ b/Master/texmf-dist/tex/generic/pst-plot/pst-plot.tex
@@ -1,4 +1,4 @@
-% $Id: pst-plot.tex 478 2011-03-22 13:55:18Z herbert $
+% $Id: pst-plot.tex 484 2011-04-13 13:07:33Z herbert $
%% BEGIN pst-plot.tex
%%
%% plotting functions and data with PSTricks.
@@ -20,8 +20,8 @@
\ifx\PSTFPloaded\endinput\else \input pst-fp.tex \fi
\ifx\MultidoLoaded\endinput\else \input multido.tex \fi
%
-\def\fileversion{1.28}
-\def\filedate{2011/03/22}
+\def\fileversion{1.29}
+\def\filedate{2011/04/13}
\message{ v\fileversion, \filedate\space (tvz,hv)}
%
\edef\TheAtCode{\the\catcode`\@}
@@ -1318,10 +1318,10 @@ D\space##1%
\pst@killglue
\addbefore@par{arrows=-,linewidth=\psk@xtickwidth\pslinewidth}
\use@par
- \psline(#2,\pst@xticksizeB)(#2,\pst@xticksizeA)
+ \psline(#2, \pst@xticksizeB)(#2,\pst@xticksizeA)
\rput[t]{#1}(! \psk@origin
- #2 \pst@number\pslabelsep \pst@number\pst@xticksizeB add
- \pst@number\psyunit div neg ){\pshlabel{#3\vphantom{1}}}}\ignorespaces}
+ #2 \pst@number\pslabelsep \pst@number\pst@xticksizeB add
+ \pst@number\psyunit div neg ){\pshlabel{#3\vphantom{1}}}}\ignorespaces}
%
%% #1 : optional arguments passed to psline
%% #2 : rotating angle
@@ -2291,6 +2291,84 @@ D\space##1%
\endgroup%
\ignorespaces}
%
+\define@boolkey[psset]{pst-plot}[Pst@]{showDerivation}[true]{}
+\psset{showDerivation}
+%
+\def\psNewton{\pst@object{psNewton}}
+\def\psNewton@i#1#2{\@ifnextchar[{\psNewton@ii{#1}{#2}}{\psNewton@iii{#1}{#2}}}
+\def\psNewton@ii#1#2[#3]#4{% #1:xStart #2:f(x) #3:f'(x) #4:number of iterations
+ \pst@killglue%
+ \begingroup%
+ \addbefore@par{showDerivation}%
+ \use@par%
+ \@nameuse{beginplot@\psplotstyle}%
+ \addto@pscode{
+ \psplot@init
+ /x #1 def
+ /F@pstplot \ifPst@algebraic (#2) tx@AlgToPs begin AlgToPs end cvx \else { #2 } \fi def
+ /F@pstplotDerive \ifPst@algebraic (#3) tx@AlgToPs begin AlgToPs end cvx \else { #3 } \fi def
+ /newxVal { % y on stack
+ F@pstplotDerive % we have m
+ div neg %\pst@number\psxunit div % new x val = -y0/m
+ } def
+ }%
+ \gdef\psplot@init{}%
+ \@pstfalse%
+ \@nameuse{testqp@\psplotstyle}%
+ \addto@pscode{
+ mark
+ x 0 \tx@ScreenCoor % start point
+ /n 2 def
+ #4 {
+ F@pstplot /yVal ED
+ x yVal \tx@ScreenCoor
+ /n n 2 add def
+ yVal newxVal x add /x ED
+ x 0 \tx@ScreenCoor
+ \ifPst@showDerivation /n n 4 add def \else moveto /n n 2 add def\fi
+ } repeat
+ pstack
+ }%
+ \@nameuse{endplot@\psplotstyle}%
+ \endgroup%
+ \ignorespaces}
+\def\psNewton@iii#1#2#3{% #1:xStart #2:f(x) #3:number of iterations
+ \pst@killglue%
+ \begingroup%
+ \addbefore@par{VarStepEpsilon=0.01,showDerivation}%
+ \use@par%
+ \@nameuse{beginplot@\psplotstyle}%
+ \addto@pscode{
+ \psplot@init
+ /epsilon \psk@VarStepEpsilon\space def
+ /x #1 def
+ /F@pstplot \ifPst@algebraic (#2) tx@AlgToPs begin AlgToPs end cvx \else { #2 } \fi def
+ /newxVal { % y on stack
+ /saveX x def
+ saveX epsilon add /x ED F@pstplot saveX epsilon sub /x ED F@pstplot sub epsilon dup add div % we have m
+ div neg % new x val = -y0/m
+ /x saveX def
+ } def
+ }%
+ \gdef\psplot@init{}%
+ \@pstfalse%
+ \@nameuse{testqp@\psplotstyle}%
+ \addto@pscode{
+ mark
+ x 0 \tx@ScreenCoor % start point
+ /n 2 def
+ #3 {
+ F@pstplot /yVal ED
+ x yVal \tx@ScreenCoor
+ yVal newxVal x add /x ED
+ x 0 \tx@ScreenCoor
+ \ifPst@showDerivation /n n 4 add def \else moveto /n n 2 add def\fi
+ } repeat
+ }%
+ \@nameuse{endplot@\psplotstyle}%
+ \endgroup%
+ \ignorespaces}
+%
\def\psResetPlotValues{%
\psset{method={}}%
}%