diff options
author | Karl Berry <karl@freefriends.org> | 2009-04-18 23:41:17 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2009-04-18 23:41:17 +0000 |
commit | 7ee741fbb4f58d9fde8a992b7975f3f4c7519cb7 (patch) | |
tree | 2e1d543acb29ea356aa94c97e1555fa14a62a7ac /Master/texmf-dist/tex/generic/pstricks-add/pstricks-add.tex | |
parent | 545fc4a8a545571c6c014897a161a6f72260766b (diff) |
pstricks-add 3.30 (17apr09)
git-svn-id: svn://tug.org/texlive/trunk@12748 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/pstricks-add/pstricks-add.tex')
-rw-r--r-- | Master/texmf-dist/tex/generic/pstricks-add/pstricks-add.tex | 95 |
1 files changed, 50 insertions, 45 deletions
diff --git a/Master/texmf-dist/tex/generic/pstricks-add/pstricks-add.tex b/Master/texmf-dist/tex/generic/pstricks-add/pstricks-add.tex index a6fcd0ad601..145b576a517 100644 --- a/Master/texmf-dist/tex/generic/pstricks-add/pstricks-add.tex +++ b/Master/texmf-dist/tex/generic/pstricks-add/pstricks-add.tex @@ -1,4 +1,4 @@ -%% $Id: pstricks-add.tex 109 2009-03-16 11:24:38Z herbert $ +%% $Id: pstricks-add.tex 112 2009-04-17 19:21:56Z herbert $ %% %% %% This is file `pstricks-add.tex', @@ -22,15 +22,16 @@ \let\PSTricksAddLoaded\endinput % % Requires some packages -\ifx\PSTricksLoaded\endinput\else\input pstricks \fi -\ifx\PSTplotLoaded\endinput\else \input pst-plot \fi -\ifx\PSTnodesLoaded\endinput\else\input pst-node \fi -\ifx\PSTthreeDLoaded\endinput\else\input pst-3d \fi -\ifx\MultidoLoaded\endinput\else \input multido \fi -\ifx\PSTXKeyLoaded\endinput\else \input pst-xkey \fi -% -\def\fileversion{3.20} -\def\filedate{2009/03/16} +\ifx\PSTricksLoaded\endinput\else \input pstricks \fi +\ifx\PSTplotLoaded\endinput\else \input pst-plot \fi +\ifx\PSTnodesLoaded\endinput\else \input pst-node \fi +\ifx\PSTthreeDLoaded\endinput\else\input pst-3d \fi +\ifx\MultidoLoaded\endinput\else \input multido \fi +\ifx\PSTXKeyLoaded\endinput\else \input pst-xkey \fi +\ifx\PSTFPloaded\endinput\else \input pst-fp \fi +% +\def\fileversion{3.30} +\def\filedate{2009/04/17} \message{`pstricks-add' v\fileversion, \filedate\space (dr,hv)} % \edef\PstAtCode{\the\catcode`\@} \catcode`\@=11\relax @@ -1638,22 +1639,24 @@ \psset{trigLabels=false} % %logLines=all|x|y|none (0,1,2,3) -\define@key[psset]{pstricks-add}{logLines}[none]{\pst@expandafter\psset@@logLines{#1}\@nil\psk@logLines} +\def\psk@logLines{3} +\define@key[psset]{pstricks-add}{logLines}[none]{\pst@expandafter\psset@@logLines#1\@nil\psk@logLines} \def\psset@@logLines#1#2\@nil#3{% \ifx#1a \let#3\z@ \Pst@maxxTickstrue\Pst@maxyTickstrue \set@xticksize{0 4pt}\set@yticksize{0 4pt}% + \def\psk@xsubticksize{1}\def\psk@ysubticksize{1}% \else \ifx#1x \let#3\@ne \Pst@maxxTickstrue\Pst@maxyTicksfalse - \set@xticksize{0 4pt}% + \set@xticksize{0 4pt}\def\psk@xsubticksize{1}% \else \ifx#1y \let#3\tw@ \Pst@maxyTickstrue\Pst@maxxTicksfalse - \set@yticksize{0 4pt}% + \set@yticksize{0 4pt}\def\psk@ysubticksize{1}% \else \ifx#1n\let#3\thr@@\else \@pstrickserr{Bad argument: `#1#2'}\@ehpa @@ -2348,6 +2351,10 @@ \def\pstScalePoints(#1,#2)#3#4{% % xScale | yScale | xOperator | yOperator % the operators can be any Postscript code + \def\pstXScale{#1 }% + \def\pstYScale{#2 }% + \def\pstXPSScale{#3 }% + \def\pstYPSScale{#4 }% \pst@def{ScalePoints}<% /y ED /x ED counttomark dup dup cvi eq not { exch pop } if @@ -2499,17 +2506,17 @@ % minX | minY | maxX | maxY | Length x-axis | length y-axis% \pst@killglue% \begingroup% - \pst@dimo=#3\p@\pst@dimp=#1\p@\multiply\pst@dimp by \m@ne% + \pst@dimo=#3\p@ \pst@dimp=#1\p@ \multiply\pst@dimp by \m@ne% \advance\pst@dimo by \pst@dimp% delta x \pst@dimm=#5% - \divide\pst@dimm by \strip@pt\pst@dimo% - \pst@xunit=\pst@dimm% + \pstFPdiv\pst@@dx{\strip@pt\pst@dimm}{\strip@pt\pst@dimo}% + \pst@xunit=\pst@@dx\p@ % - \pst@dimo=#4\p@\pst@dimp=#2\p@\multiply\pst@dimp by \m@ne% + \pst@dimo=#4\p@ \pst@dimp=#2\p@ \multiply\pst@dimp by \m@ne% \advance\pst@dimo by \pst@dimp% delta y - \ifx!#6\pst@dimm=\strip@pt\pst@dimm\pst@dimo\else\pst@dimm=#6\fi% - \divide\pst@dimm by \strip@pt\pst@dimo% - \pst@yunit=\pst@dimm% + \ifx!#6\pst@dimm=\pst@@dx\pst@dimo\else\pst@dimm=#6\fi% + \pstFPdiv\pst@@dy{\strip@pt\pst@dimm}{\strip@pt\pst@dimo}% + \pst@yunit=\pst@@dy\p@ % \pst@dimm=#1\pst@xunit% \advance\pst@dimm by \psk@llx% @@ -2532,26 +2539,17 @@ % Xorig | yorig | minX | minY | maxX | maxY | Length x-axis | length y-axis% \pst@killglue% \begingroup% - \pst@dimo=#5\p@\pst@dimp=#3\p@\multiply\pst@dimp by \m@ne% + \pst@dimo=#5\p@ \pst@dimp=#3\p@ \multiply\pst@dimp by \m@ne% \advance\pst@dimo by \pst@dimp% delta x \pst@dimm=#7% - \divide\pst@dimm by \strip@pt\pst@dimo% - \pst@xunit=\pst@dimm% + \pstFPdiv\pst@@dx{\strip@pt\pst@dimm}{\strip@pt\pst@dimo}% + \pst@xunit=\pst@@dx\p@ % \pst@dimo=#6\p@\pst@dimp=#4\p@\multiply\pst@dimp by \m@ne% \advance\pst@dimo by \pst@dimp% delta y - \ifx!#8\pst@dimm=\strip@pt\pst@dimm\pst@dimo\else\pst@dimm=#8\fi% - \divide\pst@dimm by \strip@pt\pst@dimo% - \pst@yunit=\pst@dimm% -\iffalse - \pst@dimo=#5\p@\advance\pst@dimo by -#3\p@% delta x - \pst@divide{#7}{\pst@dimo}\pst@tempA% - \pst@xunit=\pst@tempA\p@% - \pst@dimo=#6\p@\advance\pst@dimo by -#4\p@% delta y - \ifx!#8 \pst@dima=\pst@tempA\pst@dimo\else\pst@dima=#8\fi - \pst@divide\pst@dima{\pst@dimo}\pst@tempA% - \pst@yunit=\pst@tempA\p@% -\fi + \ifx!#8\pst@dimm=\pst@@dx\pst@dimo\else\pst@dimm=#8\fi% + \pstFPdiv\pst@@dy{\strip@pt\pst@dimm}{\strip@pt\pst@dimo}% + \pst@yunit=\pst@@dy\p@ % \pst@dima=#3\pst@xunit \advance\pst@dima by \psk@llx% \pst@dimb=#4\pst@yunit \advance\pst@dimb by \psk@lly% @@ -2987,7 +2985,7 @@ % % % LSM Least Square Method 2006-03-13 (hv) -\def\psLSM@ii{\addto@pscode{false \tx@NArray \psLSM@iii}} +\def\psLSM@ii{\addto@pscode{ false \tx@NArray \psLSM@iii }} \def\psLSM@iii{% /xiSquare 0 def % xi*xi /xi 0 def % xi @@ -3007,13 +3005,13 @@ /v n xifi mul xi fi mul sub n xiSquare mul xi dup mul sub div def \Pst@Debug\space 0 gt { % print the equation /Helvetica findfont 12 scalefont setfont - 0 -50 moveto (y=)show % print y= - v 20 string cvs show ( x+) show % v x+ + 0 -50 moveto (y=) show % print y= + v 20 string cvs show ( x+) show % m*x+ u \pst@number\psyunit div 20 string cvs show } if newpath (\psk@xStart) length 0 gt % special start value? { \psk@xStart\space \pst@number\psxunit mul } - { xStart } ifelse + { xStart } ifelse dup v mul u add % xStart f(xStart) moveto % goto first point x1 y(x1) (\psk@xEnd) length 0 gt % special end value? @@ -3121,11 +3119,16 @@ \psset[pstricks-add]{CMYK=true} \def\@NOTEMPTY{NOT@EMPTY}%%dr 0606 % + +\def\psplotTangent@ii#1,#2,#3\@nil{% + \def\pst@tempLeft{#1}% + \def\pst@tempRight{#2}} %% #1 : x value -%% #2 : delta x +%% #2 : delta x or x0,x1 %% #3 : function \def\psplotTangent{\pst@object{psplotTangent}}% idea from Dominique Rodriguez \def\psplotTangent@i#1#2#3{% + \expandafter\psplotTangent@ii#2,,\@nil \begin@OpenObj% % \let\pst@linetype\pst@arrowtype% % \pst@addarrowdef% @@ -3192,16 +3195,18 @@ y \pst@number\psyunit mul x \pst@number\psxunit mul Atan \ifPST@Tnormal 90 add \fi % y ATAN1 % we have the slope angle of the tangent. ATAN is defined int the pstricks.pro, patch 6 \fi + cvi 180 mod dup 90 gt { 180 sub } if % -90 <= angle <= 90 rotate % rotate, depending to the origin - /Lineto /lineto load def - [ + /Lineto /lineto load def % the pro file needs /Lineto + [ % start array of points \ifPST@Tnormal 0 0 % moveto #2 y \pst@number\psyunit mul x \pst@number\psxunit mul Atan 90 add cos div \pst@number\psxunit mul 0 % lineto - \else - -#2 \pst@number\psxunit mul 0 % moveto - #2 \pst@number\psxunit mul 0 % lineto + \else % points are in reverse order ... + \ifx\pst@tempRight\@empty #2 \else \pst@tempRight\space \fi \pst@number\psxunit mul 0 % moveto + \if@star 0 \else + \ifx\pst@tempRight\@empty #2 neg \else \pst@tempLeft\space \fi \pst@number\psxunit mul \fi 0 % lineto \fi \pst@cp % kill the currentpoint, if any false % don't show the points |