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/doc/generic/pstricks-add | |
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/doc/generic/pstricks-add')
-rw-r--r-- | Master/texmf-dist/doc/generic/pstricks-add/Changes | 13 | ||||
-rw-r--r-- | Master/texmf-dist/doc/generic/pstricks-add/README | 7 | ||||
-rw-r--r-- | Master/texmf-dist/doc/generic/pstricks-add/pst-fp.tex | 499 | ||||
-rw-r--r-- | Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.dat | 2 | ||||
-rw-r--r-- | Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.pdf | bin | 2022749 -> 2044104 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.tex | 62 |
6 files changed, 573 insertions, 10 deletions
diff --git a/Master/texmf-dist/doc/generic/pstricks-add/Changes b/Master/texmf-dist/doc/generic/pstricks-add/Changes index 2add814c3c2..d39f665c68b 100644 --- a/Master/texmf-dist/doc/generic/pstricks-add/Changes +++ b/Master/texmf-dist/doc/generic/pstricks-add/Changes @@ -1,4 +1,4 @@ -%% $Id: Changes 109 2009-03-16 11:24:38Z herbert $ +%% $Id: Changes 112 2009-04-17 19:21:56Z herbert $ %% pstricks-add.pro ----------- v 0.22 2009-03-17 - add LineByHand stuff @@ -30,11 +30,18 @@ pstricks-add.pro ----------- pstricks-add.sty ----------- (hv) + v. 0.13 2009-04-17 change pro file version number v. 0.12 2007-11-18 change pro file version number v. 0.11 2007-09-04 add a message for loading the prolouge file pstrick-add.pro pstricks-add.tex ----------- (Dominik Rodriguez/hv) + v 3.30 2009-04-17 - rewrote unit calculation for \psgraph. It uses now the + package pst-fp, which has the division macro (stolen + from the fp package) + - new star option for psPlotTangent + - new optional argument for a x interval for psPlotTangent + . new macro pslineByHand to make "hand drawn lines" v 3.20 2009-03-16 - add option showOriginTick, similiar to showorigin from the basic pst-plot v 3.19 2009-03-06 - fix introduced bug with division in the \psgraph macro @@ -219,3 +226,7 @@ pstricks-add.tex ----------- (Dominik Rodriguez/hv) v 2.19 2004-10-20 small changes v 2.18 2004-10-20 add \ncbarr v 2.17 2004-10-14 new multiple arrows + + +pst-fp.tex ----------- (hv) + v 0.02 2009-04-02 initial version diff --git a/Master/texmf-dist/doc/generic/pstricks-add/README b/Master/texmf-dist/doc/generic/pstricks-add/README index d776273808e..15d83ae5b24 100644 --- a/Master/texmf-dist/doc/generic/pstricks-add/README +++ b/Master/texmf-dist/doc/generic/pstricks-add/README @@ -18,6 +18,7 @@ to the pstricks mailing list and has some more new features: o Gouraud shading o braces as node connection/linestyle o line style bar + o lines, drawn "by hand" o arrows, arrows, arrows, ... - pst-plot @@ -45,9 +46,11 @@ to the pstricks mailing list and has some more new features: pstricks-add.pro : the prolog file for pstricks-add pstricks-add-doc.tex: the included doc file +pst-fp.tex : for floating point division -Save the files pstricks-add.sty|pro|tex in a directory, which is part of your -local TeX tree. The pro file should go into $TEXMF/dvips/pstricks/ +Save the files pstricks-add.sty|pro|tex and pst-fp.tex in a directory, +which is part of your local TeX tree. The pro file should go +into $TEXMF/dvips/pstricks/ Then do not forget to run texhash to update this tree. For more information see the documentation of your LATEX distribution on installing packages into your local TeX system or read the diff --git a/Master/texmf-dist/doc/generic/pstricks-add/pst-fp.tex b/Master/texmf-dist/doc/generic/pstricks-add/pst-fp.tex new file mode 100644 index 00000000000..8cc3d9751f2 --- /dev/null +++ b/Master/texmf-dist/doc/generic/pstricks-add/pst-fp.tex @@ -0,0 +1,499 @@ +%% $Id: pst-fp.tex 112 2009-04-17 19:21:56Z herbert $ +%% +%% +%% This is file `pst-fp.tex', +%% +%% IMPORTANT NOTICE: +%% +%% Package `pst-fp.tex' +%% +%% Herbert Voss <Herbert.Voss _at_ pstricks.de> +%% stolen from the fp package by Michael Mehlich +%% +%% This program can be redistributed and/or modified under the terms +%% of the LaTeX Project Public License Distributed from CTAN archives +%% in directory macros/latex/base/lppl.txt. +%% +%% DESCRIPTION: +%% `pst-fp' is a PSTricks related package for a division +%% +\csname PSTFPloaded\endcsname +\let\PSTFPloaded\endinput +% +% Requires some packages +\ifx\PSTricksLoaded\endinput\else\input pstricks \fi +% +\def\fileversion{0.02} +\def\filedate{2009/04/02} +\message{`pst-fp' v\fileversion, \filedate\space (hv)} +% +\edef\PstAtCode{\the\catcode`\@} \catcode`\@=11\relax + +%fixed point arithmetic with values between (including) +% -999999999999999999.999999999999999999 +% and +999999999999999999.999999999999999999 + +\def\pstFPdiv#1#2#3{\pstFP@callc\pstFP@div#1{#2}{#3}} % #1 := #2/#3 + +\countdef\pstFP@actcounter=10 % register 0 for counter +\ifnum\pstFP@actcounter<60\relax \pstFP@actcounter=60\fi + +\newcount\pstFP@xs %sign of 1st value +\newcount\pstFP@xia%integer part of 1st value +\newcount\pstFP@xib%integer part of 1st value +\newcount\pstFP@xfa%fractional part of 1st value +\newcount\pstFP@xfb%fractional part of 1st value + +\countdef\pstFP@ys=5 %sign of 2nd value +\countdef\pstFP@yia=6%integer part of 2nd value +\countdef\pstFP@yib=7%integer part of 2nd value +\countdef\pstFP@yfa=8%fractional part of 2nd value +\countdef\pstFP@yfb=9%fractional part of 2nd value + +\countdef\pstFP@xk=10 %registers for splitting 1st value +\countdef\pstFP@xl=11 +\countdef\pstFP@xm=12 +\countdef\pstFP@xn=13 +\countdef\pstFP@xo=14 +\countdef\pstFP@xp=15 +\countdef\pstFP@xq=16 +\countdef\pstFP@xr=17 +\countdef\pstFP@xz=18 +\countdef\pstFP@xt=19 +\countdef\pstFP@xu=20 +\countdef\pstFP@xv=21 + +\countdef\pstFP@yk=22 %registers for splitting 2nd value +\countdef\pstFP@yl=23 +\countdef\pstFP@ym=24 +\countdef\pstFP@yn=25 +\countdef\pstFP@yo=26 +\countdef\pstFP@yp=27 +\countdef\pstFP@yq=28 +\countdef\pstFP@yr=29 +\countdef\pstFP@yz=30 +\countdef\pstFP@yt=31 +\countdef\pstFP@yu=32 +\countdef\pstFP@yv=33 + +\newcount\pstFP@rega %auxiliary registers +\newcount\pstFP@regb +\countdef\pstFP@regc=36 +\countdef\pstFP@regd=37 +\countdef\pstFP@rege=38 + +\countdef\pstFP@rs=39 %result registers +\countdef\pstFP@ria=40 +\countdef\pstFP@rib=41 +\countdef\pstFP@rfa=42 +\countdef\pstFP@rfb=43 + +\newcount\pstFP@regs %local auxiliary registers +\countdef\pstFP@count=45 +\countdef\pstFP@res=46 +\countdef\pstFP@shift=47 +\newcount\pstFP@times + +%auxiliary macros which may be used in all of the following macros +\newif\ifpstFP@test + +\def\pstFP@ignorenext#1{} +\def\pstFP@first#1#2\relax{#1} +\def\pstFP@swallow#1\relax{} +% +\def\ifpstFP@zero#1{% + \ifnum% + \expandafter\ifnum\csname pstFP@#1ia\endcsname=0 0\else1\fi% + \expandafter\ifnum\csname pstFP@#1ib\endcsname=0 0\else1\fi% + \expandafter\ifnum\csname pstFP@#1fa\endcsname=0 0\else1\fi% + \expandafter\ifnum\csname pstFP@#1fb\endcsname=0 0\else1\fi% + =0\relax% +} +% +%read value +% +\def\pstFP@correctintcounter#1\relax{% + {\edef\pstFP@tmp{#1}% + \pstFP@count=0\relax% + \loop% + \edef\pstFP@tmpa{\expandafter\pstFP@first\pstFP@tmp\noexpand\relax}% + \expandafter\ifx\pstFP@tmpa0\relax% + \advance\pstFP@count1\relax% + \edef\pstFP@tmp{\expandafter\pstFP@ignorenext\pstFP@tmp}% + \repeat% + \ifnum\pstFP@count>18\relax% + \typeout{>>>> Overflow}% + \fi% + \expandafter\if!\pstFP@tmp!% + \advance\pstFP@count-18\relax% + \pstFP@count=-\pstFP@count% + \loop% + \ifnum\pstFP@count>0\relax% + \pstFP@regc=\pstFP@rega% + \divide\pstFP@rega10\relax\multiply\pstFP@rega10\relax% + \advance\pstFP@regc-\pstFP@rega\multiply\pstFP@regc100000000\relax% + \divide\pstFP@rega10\relax% + \divide\pstFP@regb10\relax\advance\pstFP@regb\pstFP@regc% + \advance\pstFP@count-1\relax% + \repeat% + \global\pstFP@rega=\pstFP@rega% + \global\pstFP@regb=\pstFP@regb% + \else% + \typeout{>>>>Number too big}% + \fi% + }% +} +\def\pstFP@@setintcounter#1#2#3#4#5#6#7#8#9{% + \pstFP@regb=#1#2#3#4#5#6#7#8#9\relax% + \pstFP@correctintcounter% +} +\def\pstFP@setintcounter#1#2#3#4#5#6#7#8#9{% + \pstFP@rega=#1#2#3#4#5#6#7#8#9\relax% + \pstFP@@setintcounter% +} + +\def\pstFP@@setfractcounter#1#2#3#4#5#6#7#8#9{% + \pstFP@regb=#1#2#3#4#5#6#7#8#9\relax% + \pstFP@swallow% +} +\def\pstFP@setfractcounter#1#2#3#4#5#6#7#8#9{% + \pstFP@rega=#1#2#3#4#5#6#7#8#9\relax% + \pstFP@@setfractcounter% +} + +\def\pstFP@getsign#1\relax{% + {\pstFP@regs=1\relax% + \edef\pstFP@tmp{#1}% + \loop% + \edef\pstFP@tmpa{\expandafter\pstFP@first\pstFP@tmp\noexpand\relax}% + \expandafter\ifx\pstFP@tmpa-\relax% + \multiply\pstFP@regs-1\relax% + \fi% + \ifnum\expandafter\ifx\pstFP@tmpa-1\else0\fi\expandafter\ifx\pstFP@tmpa+1\else0\fi>0% + \edef\pstFP@tmp{\expandafter\pstFP@ignorenext\pstFP@tmp}% + \repeat% + \global\let\pstFP@tmp\pstFP@tmp% + \global\pstFP@regs=\pstFP@regs% + }% +} + +\def\pstFP@removeleadingzeros#1\relax{% + {\edef\pstFP@tmp{#1}% + \loop% + \edef\pstFP@tmpa{\expandafter\pstFP@first\pstFP@tmp\noexpand\relax}% + \expandafter\ifx\pstFP@tmpa0\relax% + \edef\pstFP@tmp{\expandafter\pstFP@ignorenext\pstFP@tmp}% + \repeat% + \global\let\pstFP@tmp\pstFP@tmp% + }% +} + +\newif\ifpstFP@nonstop +\def\pstFP@strip#1{% + {\edef\pstFP@tmp{#1}% + \edef\pstFP@tmpb{}% + \ifx\pstFP@tmp\@empty\else% + \pstFP@nonstoptrue% + \loop% + \edef\pstFP@tmpa{\expandafter\pstFP@first\pstFP@tmp\noexpand\relax}% + \expandafter\ifx\pstFP@tmpa-\relax\edef\pstFP@tmpb{\pstFP@tmpb\pstFP@tmpa}\else% + \expandafter\ifx\pstFP@tmpa+\relax\edef\pstFP@tmpb{\pstFP@tmpb\pstFP@tmpa}\else% + \expandafter\ifx\pstFP@tmpa0\relax\edef\pstFP@tmpb{\pstFP@tmpb\pstFP@tmpa}\else% + \expandafter\ifx\pstFP@tmpa1\relax\edef\pstFP@tmpb{\pstFP@tmpb\pstFP@tmpa}\else% + \expandafter\ifx\pstFP@tmpa2\relax\edef\pstFP@tmpb{\pstFP@tmpb\pstFP@tmpa}\else% + \expandafter\ifx\pstFP@tmpa3\relax\edef\pstFP@tmpb{\pstFP@tmpb\pstFP@tmpa}\else% + \expandafter\ifx\pstFP@tmpa4\relax\edef\pstFP@tmpb{\pstFP@tmpb\pstFP@tmpa}\else% + \expandafter\ifx\pstFP@tmpa5\relax\edef\pstFP@tmpb{\pstFP@tmpb\pstFP@tmpa}\else% + \expandafter\ifx\pstFP@tmpa6\relax\edef\pstFP@tmpb{\pstFP@tmpb\pstFP@tmpa}\else% + \expandafter\ifx\pstFP@tmpa7\relax\edef\pstFP@tmpb{\pstFP@tmpb\pstFP@tmpa}\else% + \expandafter\ifx\pstFP@tmpa8\relax\edef\pstFP@tmpb{\pstFP@tmpb\pstFP@tmpa}\else% + \expandafter\ifx\pstFP@tmpa9\relax\edef\pstFP@tmpb{\pstFP@tmpb\pstFP@tmpa}\else% + \ifx\pstFP@tmpa\@empty\pstFP@nonstopfalse\else% + \ifx\pstFP@tmpa\space\pstFP@nonstopfalse\else% + \typeout{>>> Illegal character \pstFP@tmpa\space found in float number}% + \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi% + \edef\pstFP@tmp{\expandafter\pstFP@ignorenext\pstFP@tmp}% + \ifx\pstFP@tmp\@empty\pstFP@nonstopfalse\fi% + \ifpstFP@nonstop% + \repeat% + \fi% + \global\let\pstFP@tmp\pstFP@tmpb% + }% +} + +\def\pstFP@readvalue#1#2#3{% + % #1 macro family to catch the value + % #2.#3 value + % + % regular expression [+|-]*[d]_0^18.[d]* + % + \pstFP@strip{#2}% + %sign + \expandafter\pstFP@getsign\pstFP@tmp\relax% + \csname pstFP@#1s\endcsname=\pstFP@regs% + % + %integer part + \pstFP@removeleadingzeros\pstFP@tmp\relax% + \expandafter\pstFP@setintcounter\pstFP@tmp000000000000000000\relax% + \csname pstFP@#1ia\endcsname=\pstFP@rega% + \csname pstFP@#1ib\endcsname=\pstFP@regb% + % + %fractional part + \pstFP@strip{#3}% + \expandafter\pstFP@setfractcounter\pstFP@tmp000000000000000000\relax% + \csname pstFP@#1fa\endcsname=\pstFP@rega% + \csname pstFP@#1fb\endcsname=\pstFP@regb% + % + %correct sign + \ifnum\pstFP@rega=0\relax% + \ifnum\pstFP@regb=0\relax% + \expandafter\ifnum\csname pstFP@#1ib\endcsname=0\relax% + \expandafter\ifnum\csname pstFP@#1ia\endcsname=0\relax% + \csname pstFP@#1s\endcsname=1\relax% + \fi% + \fi% + \fi% + \fi% +} +% +%store value in macro +% +\def\pstFP@store#1#2{% + % #1 macro + % #2 macro family (value) to store + % + \ifpstFP@zero{#2}% + \csname pstFP@#2s\endcsname=1\relax% + \fi% + \expandafter\ifnum\csname pstFP@#2s\endcsname<0\relax% + \edef#1{-}% + \else% + \edef#1{}% + \fi% + \expandafter\ifnum\csname pstFP@#2ia\endcsname=0\relax% + \expandafter\ifnum\csname pstFP@#2ib\endcsname=0\relax% + \edef#1{#10}% + \else% + \edef#1{#1\expandafter\the\csname pstFP@#2ib\endcsname}% + \fi% + \else% + \expandafter\advance\csname pstFP@#2ib\endcsname1000000000\relax% + \edef#1{#1\expandafter\the\csname pstFP@#2ia\endcsname\expandafter\pstFP@ignorenext\the\csname pstFP@#2ib\endcsname}% + \fi% + \expandafter\advance\csname pstFP@#2fa\endcsname1000000000\relax% + \expandafter\advance\csname pstFP@#2fb\endcsname1000000000\relax% + \edef#1{#1\noexpand.\expandafter\pstFP@ignorenext\the\csname pstFP@#2fa\endcsname\expandafter\pstFP@ignorenext\the\csname pstFP@#2fb\endcsname}% +} +%macros to expand some arguments +% +\def\pstFP@callc#1#2#3#4{% + % #1 macro to call + % #2 macro, which gets the result + % #3 1st value + % #4 2nd value + % expand the values and split them into the integer and the fractional parts + \edef\next{\noexpand#1\noexpand#2#3..\noexpand\relax#4..\noexpand\relax}% + \next% +} +% +\def\pstFP@divten#1{% + \expandafter\pstFP@regc\csname pstFP@#1ia\endcsname% + \expandafter\divide\csname pstFP@#1ia\endcsname10\relax% + \expandafter\pstFP@regb\csname pstFP@#1ia\endcsname% + \multiply\pstFP@regb10\relax% + \advance\pstFP@regc-\pstFP@regb% + \multiply\pstFP@regc100000000\relax% + % + \expandafter\pstFP@rega\csname pstFP@#1ib\endcsname% + \expandafter\divide\csname pstFP@#1ib\endcsname10\relax% + \expandafter\pstFP@regb\csname pstFP@#1ib\endcsname% + \multiply\pstFP@regb10\relax% + \advance\pstFP@rega-\pstFP@regb% + \multiply\pstFP@rega100000000\relax% + \expandafter\advance\csname pstFP@#1ib\endcsname\pstFP@regc% + % + \expandafter\pstFP@regc\csname pstFP@#1fa\endcsname% + \expandafter\divide\csname pstFP@#1fa\endcsname10\relax% + \expandafter\pstFP@regb\csname pstFP@#1fa\endcsname% + \multiply\pstFP@regb10\relax% + \advance\pstFP@regc-\pstFP@regb% + \multiply\pstFP@regc100000000\relax% + \expandafter\advance\csname pstFP@#1fa\endcsname\pstFP@rega% + % + \expandafter\divide\csname pstFP@#1fb\endcsname10\relax% + \expandafter\advance\csname pstFP@#1fb\endcsname\pstFP@regc% +} +% +\def\pstFP@multen#1{% + \expandafter\multiply\csname pstFP@#1ia\endcsname10\relax% + \expandafter\ifnum\csname pstFP@#1ib\endcsname<100000000\relax% + \else% + \expandafter\pstFP@regc\csname pstFP@#1ib\endcsname% + \divide\pstFP@regc100000000% + \expandafter\advance\csname pstFP@#1ia\endcsname\pstFP@regc% + \multiply\pstFP@regc100000000% + \expandafter\advance\csname pstFP@#1ib\endcsname-\pstFP@regc% + \fi% + \expandafter\multiply\csname pstFP@#1ib\endcsname10\relax% + \expandafter\ifnum\csname pstFP@#1fa\endcsname<100000000\relax% + \else% + \expandafter\pstFP@regc\csname pstFP@#1fa\endcsname% + \divide\pstFP@regc100000000% + \expandafter\advance\csname pstFP@#1ib\endcsname\pstFP@regc% + \multiply\pstFP@regc100000000% + \expandafter\advance\csname pstFP@#1fa\endcsname-\pstFP@regc% + \fi% + \expandafter\multiply\csname pstFP@#1fa\endcsname10\relax% + \expandafter\ifnum\csname pstFP@#1fb\endcsname<100000000\relax% + \else% + \expandafter\pstFP@regc\csname pstFP@#1fb\endcsname% + \divide\pstFP@regc100000000% + \expandafter\advance\csname pstFP@#1fa\endcsname\pstFP@regc% + \multiply\pstFP@regc100000000% + \expandafter\advance\csname pstFP@#1fb\endcsname-\pstFP@regc% + \fi% + \expandafter\multiply\csname pstFP@#1fb\endcsname10\relax% +} +% +\def\pstFP@counttimes{% + {\global\pstFP@times=0\relax% + \loop% + \ifnum% + \ifnum\pstFP@xia>\pstFP@yia1% + \else\ifnum\pstFP@xia<\pstFP@yia0% + \else% + \ifnum\pstFP@xib>\pstFP@yib1% + \else\ifnum\pstFP@xib<\pstFP@yib0% + \else% + \ifnum\pstFP@xfa>\pstFP@yfa1% + \else\ifnum\pstFP@xfa<\pstFP@yfa0% + \else% + \ifnum\pstFP@xfb>\pstFP@yfb1% + \else\ifnum\pstFP@xfb<\pstFP@yfb0% + \else% + 1% + \fi\fi% + \fi\fi% + \fi\fi% + \fi\fi% + =1\relax% + \global\advance\pstFP@times1\relax% + \global\advance\pstFP@xfb-\pstFP@yfb% + \ifnum\pstFP@xfb<0\relax% + \global\advance\pstFP@xfb1000000000\relax% + \global\advance\pstFP@xfa-1\relax% + \fi% + \global\advance\pstFP@xfa-\pstFP@yfa% + \ifnum\pstFP@xfa<0\relax% + \global\advance\pstFP@xfa1000000000\relax% + \global\advance\pstFP@xib-1\relax% + \fi% + \global\advance\pstFP@xib-\pstFP@yib% + \ifnum\pstFP@xib<0\relax% + \global\advance\pstFP@xib1000000000\relax% + \global\advance\pstFP@xia-1\relax% + \fi% + \global\advance\pstFP@xia-\pstFP@yia% + \repeat% + }% +} +% +\def\pstFP@div#1#2.#3.#4\relax#5.#6.#7\relax{% + % #1 macro, which gets the result + % #2 integer part of 1st value + % #3 fractional part of 1st value + % #4 dummy to swallow everthing after the 2nd '.' + % #5 integer part of 2nd value + % #6 fractional part of 2nd value + % #7 dummy to swallow everthing after the 2nd '.' + % + % algorithmic idea (for x>0, y>0) + % - %determine \pstFP@shift such that y*10^\pstFP@shift <100000000<=y*10^(\pstFP@shift+1) + % - %determine \pstFP@shift' such that x*10^\pstFP@shift'<100000000<=x*10^(\pstFP@shift+1) + % - x=x*\pstFP@shift' + % - y=y*\pstFP@shift + % - \pstFP@shift=\pstFP@shift-\pstFP@shift' + % - res=0 + % - while y>0 %fixed-point representation! + % - \pstFP@times=0 + % - while x>y + % - \pstFP@times=\pstFP@times+1 + % - x=x-y + % - end + % - y=y/10 + % - res=10*res+\pstFP@times/1000000000 + % - end + % - %shift the result according to \pstFP@shift + % + {\pstFP@readvalue{x}{#2}{#3}% + \pstFP@readvalue{y}{#5}{#6}% + % + %sign + \multiply\pstFP@xs\pstFP@ys% + \pstFP@rs=\pstFP@xs% + % + %compute division + \ifpstFP@zero{y}% + \typeout{>>>>Division by zero}% + \else% + \ifpstFP@zero{x}\def\next##1{\edef\pstFP@tmp{0}}\else\def\next##1{##1}\fi% + \next% + {\pstFP@shift=0\relax% + \loop% + \ifnum\pstFP@yia<100000000\relax% + \pstFP@multen{y}% + \advance\pstFP@shift1\relax% + \repeat% + \loop% + \ifnum\pstFP@xia<100000000\relax% + \pstFP@multen{x}% + \advance\pstFP@shift-1\relax% + \repeat% + \pstFP@ria=0\pstFP@rib=0\pstFP@rfa=0\pstFP@rfb=0\relax% + \loop% + \ifpstFP@zero{y}\else% + \pstFP@counttimes%divides x by \pstFP@times*y + \pstFP@divten{y}% + \pstFP@multen{r}% + \advance\pstFP@rfb\pstFP@times% + \ifnum\pstFP@rfb<1000000000\relax\else% + \advance\pstFP@rfa1\advance\pstFP@rfb-1000000000\relax% + \ifnum\pstFP@rfa<1000000000\relax\else% + \advance\pstFP@rib1\advance\pstFP@rfa-1000000000\relax% + \ifnum\pstFP@rib<1000000000\relax\else% + \advance\pstFP@ria1\advance\pstFP@rib-1000000000\relax% + \fi% + \fi% + \fi% + \repeat% + \loop% + \ifnum\pstFP@shift>17% + \advance\pstFP@shift-1\relax% + \ifnum\pstFP@ria<100000000\else\pstFP@ria=-1\fi% + \ifnum\pstFP@ria<0\pstFP@ria=-1\fi% + \pstFP@multen{r}% + \repeat% + \ifnum\pstFP@ria<1000000000\else\pstFP@ria=-1\fi% + \loop% + \ifnum\pstFP@shift<17% + \advance\pstFP@shift1\relax% + \pstFP@divten{r}% + \repeat% + \ifnum\pstFP@ria<0\relax% + \typeout{>>>>Overflow}% + \else% + \pstFP@store\pstFP@tmp{r}% + \fi% + }% + \fi% + % + \global\let\pstFP@tmp=\pstFP@tmp% + % + }% + \let#1\pstFP@tmp% +} +% +\catcode`\@=\PstAtCode\relax +% +%% END: pst-fp.tex +\endinput diff --git a/Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.dat b/Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.dat index d26aea31920..7ec604ca2a0 100644 --- a/Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.dat +++ b/Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.dat @@ -1,3 +1,5 @@ +%% $Id: pstricks-add-doc.dat 112 2009-04-17 19:21:56Z herbert $ + \begin{filecontents*}{demo0.data} 0.1414 0.0052 0.2828 0.0217 diff --git a/Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.pdf b/Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.pdf Binary files differindex b9b79770798..8689eb79e57 100644 --- a/Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.pdf +++ b/Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.pdf diff --git a/Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.tex b/Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.tex index f26b4809112..cd13e8fcf5a 100644 --- a/Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.tex +++ b/Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.tex @@ -1,4 +1,4 @@ -%% $Id: pstricks-add-doc.tex 111 2009-03-16 19:53:49Z herbert $ +%% $Id: pstricks-add-doc.tex 112 2009-04-17 19:21:56Z herbert $ \documentclass[11pt,english,BCOR10mm,DIV12,bibliography=totoc,parskip=false,smallheadings headexclude,footexclude,oneside]{pst-doc} \listfiles @@ -360,6 +360,47 @@ lines. The number of arguments is no longer limited. \end{LTXexample} \clearpage +%-------------------------------------------------------------------------------------- +\section{"`Handmade"' lines :-)} +%-------------------------------------------------------------------------------------- + +\begin{BDef} +\Lcs{pslineByHand}\OptArgs\Largr(\coord1)\Largr(\coord2)\Largr(\coord3) \ldots +\end{BDef} + +\begin{LTXexample}[width=0.4\linewidth] +\begin{pspicture}(4,6) +\psset{unit=2cm} + \pslineByHand[linecolor=red](0,0)(0,2)(2,2)(2,0)(0,0)(2,2)(1,3)(0,2)(2,0) +\end{pspicture} +\end{LTXexample} + +\iffalse + \pslineByHand( 1.20, 1.50)( 1.20, 1.51)( 1.20, 1.53)( 1.20, 1.54)( 1.19, 1.55)( 1.19, 1.56) + ( 1.19, 1.57)( 1.18, 1.59)( 1.18, 1.60)( 1.17, 1.61)( 1.16, 1.62)( 1.15, 1.63)( 1.15, 1.64) + ( 1.14, 1.65)( 1.13, 1.65)( 1.12, 1.66)( 1.11, 1.67)( 1.10, 1.68)( 1.09, 1.68)( 1.07, 1.69) + ( 1.06, 1.69)( 1.05, 1.69)( 1.04, 1.70)( 1.03, 1.70)( 1.01, 1.70)( 1.00, 1.70)( 0.99, 1.70) + ( 0.97, 1.70)( 0.96, 1.70)( 0.95, 1.69)( 0.94, 1.69)( 0.93, 1.69)( 0.91, 1.68)( 0.90, 1.68) + ( 0.89, 1.67)( 0.88, 1.66)( 0.87, 1.65)( 0.86, 1.65)( 0.85, 1.64)( 0.85, 1.63)( 0.84, 1.62) + ( 0.83, 1.61)( 0.82, 1.60)( 0.82, 1.59)( 0.81, 1.57)( 0.81, 1.56)( 0.81, 1.55)( 0.80, 1.54) + ( 0.80, 1.53)( 0.80, 1.51)( 0.80, 1.50)( 0.80, 1.49)( 0.80, 1.47)( 0.80, 1.46)( 0.81, 1.45) + ( 0.81, 1.44)( 0.81, 1.43)( 0.82, 1.41)( 0.82, 1.40)( 0.83, 1.39)( 0.84, 1.38)( 0.85, 1.37) + ( 0.85, 1.36)( 0.86, 1.35)( 0.87, 1.35)( 0.88, 1.34)( 0.89, 1.33)( 0.90, 1.32)( 0.91, 1.32) + ( 0.93, 1.31)( 0.94, 1.31)( 0.95, 1.31)( 0.96, 1.30)( 0.97, 1.30)( 0.99, 1.30)( 1.00, 1.30) + ( 1.01, 1.30)( 1.03, 1.30)( 1.04, 1.30)( 1.05, 1.31)( 1.06, 1.31)( 1.07, 1.31)( 1.09, 1.32) + ( 1.10, 1.32)( 1.11, 1.33)( 1.12, 1.34)( 1.13, 1.35)( 1.14, 1.35)( 1.15, 1.36)( 1.15, 1.37) + ( 1.16, 1.38)( 1.17, 1.39)( 1.18, 1.40)( 1.18, 1.41)( 1.19, 1.43)( 1.19, 1.44)( 1.19, 1.45) + ( 1.20, 1.46)( 1.20, 1.47)( 1.20, 1.49)( 1.20, 1.50) +\fi + +\begin{LTXexample}[pos=t] +\begin{pspicture}(\linewidth,3) +\multido{\rA=0.00+0.25}{12}{\pslineByHand[linecolor=blue](0,\rA)(\linewidth,\rA)} +\end{pspicture} +\end{LTXexample} + + +\clearpage %-------------------------------------------------------------------------------------- \section{\nxLcs{rmultiput}: a multiple \nxLcs{rput}} @@ -5406,6 +5447,12 @@ calculates the slope and takes this for the tangent. This may be problematic in some cases of special functions or $x$ values, then it may be appropriate to use the Derive option. +\begin{BDef} +\LcsStar{psplotTangent}\OptArgs\Largb{x}\Largb{dx}\Largb{function} +\end{BDef} + + + The macro expects three parameters: \begin{description} @@ -5449,6 +5496,7 @@ radian unit! \end{pspicture} \end{lstlisting} +The star version plots only the tangent line in the positive $x$-direction: \begin{center} \bgroup @@ -5456,9 +5504,9 @@ radian unit! \begin{pspicture}(-7.5,-2.5)(7.5,4)%\psgrid \psaxes{->}(0,0)(-7.5,-2)(7.5,3.5) \psplot[linewidth=1.5pt,algebraic,plotpoints=500]{-7.5}{7.5}{\Falg} - \multido{\n=-7+1}{8}{\psplotTangent[linecolor=red,arrows=<->,arrowscale=2,algebraic]{\n}{1}{\Falg}} - \multido{\n=0+1}{8}{\psplotTangent[linecolor=magenta,% - arrows=<->,arrowscale=2,algebraic,Derive={\Fpalg}]{\n}{1}{\Falg}} + \multido{\n=-7+1}{8}{\psplotTangent*[linecolor=red,arrows=->,arrowscale=2,algebraic]{\n}{1}{\Falg}} + \multido{\n=0+1}{8}{\psplotTangent*[linecolor=magenta,% + arrows=->,arrowscale=2,algebraic,Derive={\Fpalg}]{\n}{1}{\Falg}} \end{pspicture} \egroup \end{center} @@ -5468,9 +5516,9 @@ radian unit! \begin{pspicture}(-7.5,-2.5)(7.5,4)%\psgrid \psaxes{->}(0,0)(-7.5,-2)(7.5,3.5) \psplot[linewidth=1.5pt,algebraic,plotpoints=500]{-7.5}{7.5}{\Falg} - \multido{\n=-7+1}{8}{\psplotTangent[linecolor=red,arrows=<->,arrowscale=2,algebraic]{\n}{1}{\Falg}} - \multido{\n=0+1}{8}{\psplotTangent[linecolor=magenta,% - arrows=<->,arrowscale=2,algebraic,§\ON§Derive={\Fpalg}§\OFF§]{\n}{1}{\Falg}} + \multido{\n=-7+1}{8}{\psplotTangent*[linecolor=red,arrows=->,arrowscale=2,algebraic]{\n}{1}{\Falg}} + \multido{\n=0+1}{8}{\psplotTangent*[linecolor=magenta,% + arrows=->,arrowscale=2,algebraic,Derive={\Fpalg}]{\n}{1}{\Falg}} \end{pspicture} \end{lstlisting} |