diff options
-rw-r--r-- | Master/texmf-dist/doc/generic/pstricks-add/Changes | 5 | ||||
-rw-r--r-- | Master/texmf-dist/doc/generic/pstricks-add/README | 58 | ||||
-rw-r--r-- | Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.pdf | bin | 1769130 -> 1787845 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.tex | 128 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/pstricks-add/pstricks-add.tex | 185 |
5 files changed, 360 insertions, 16 deletions
diff --git a/Master/texmf-dist/doc/generic/pstricks-add/Changes b/Master/texmf-dist/doc/generic/pstricks-add/Changes index 94ef0f29fc2..ea4a67a0325 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 431 2010-12-13 10:53:46Z herbert $ +%% $Id: Changes 439 2010-12-18 18:45:23Z herbert $ %% pstricks-add.pro ----------- 0.23 2009-12-20 - add RGBtoGRAY and WavelengthToGRAY @@ -39,6 +39,9 @@ pstricks-add.sty ----------- (hv) pstricks-add.tex ----------- (Dominik Rodriguez/hv) + v 3.48 2010-12-18 - add macro \psCircleTangents for drawing tangent + lines of a point and a circle or two circles. + v 3.47 2010-12-14 - save the absolute coordinates of \psVector in node names v 3.46 2010-12-13 - added new macro \psVector for drawing vectors with relative coordinates (hv) v 3.45 2010-11-01 - modified \Put for checking coor type (hv) diff --git a/Master/texmf-dist/doc/generic/pstricks-add/README b/Master/texmf-dist/doc/generic/pstricks-add/README new file mode 100644 index 00000000000..852dd71f408 --- /dev/null +++ b/Master/texmf-dist/doc/generic/pstricks-add/README @@ -0,0 +1,58 @@ +pstricks-add redefines a lot of the pstricks macros and uses the extended +version of the keyval package. So be sure that you +- pstricks-add depends on the pstricks.pro Version 1.05, 2008/06/25 + you can get it from http://perce.de/LaTeX/pstricks/ or CTAN +- load pstricks-add as last pstricks related package +- have installed xkeyval with the special pst-xkey + (CTAN: tex-archive/macros/latex/contrib/xkeyval/) +- do not load another package after pstricks-add, which loads + the old keyval.sty or pst-key.tex + +pstricks-add collects a lot of the code which was posted +to the pstricks mailing list and has some more new features: + +- pstricks + o random dots + O braces + o define and calculate colors on PS side + o Gouraud shading + o braces as node connection/linestyle + o line style bar + o lines, drawn "by hand" + o arrows, arrows, arrows, ... + +- pst-plot + o new syntax for \psplot and \psparametricplot + o new environment psgraph + o new macro pstScalePoints + o new option for logarithmic axes + o new macro and options for ticklines + o new plot option bar and option barwidth + o new options step, start end for plotting data files + o new options xLabel, yLabel + o new option plotNo for multiple data files x y1 y2 y3 ... + o new macro psplotTangent + o new macro psplotDiffEqn + o new option algebraic for infix notation + o new option changeOrder + +- pst-node + o new macro nclineII for a two-colored line + o new option lineAngle for ncdiag + o new macros for interpolation nodes + and linear combination of two vectors + o new macro ncbarr (line with 5 segments) + + +pstricks-add.pro : the prolog file for pstricks-add +pstricks-add-doc.tex: the included doc file +pst-fp.tex : for floating point multiplication and division + +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 +TeX Frequently Asked Questions: +(http://www.tex.ac.uk/cgi-bin/texfaq2html?label=instpackages). 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 768d62de8f4..b2947990e5a 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 e186bbc1525..8cdd5d020d9 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 431 2010-12-13 10:53:46Z herbert $ +%% $Id: pstricks-add-doc.tex 439 2010-12-18 18:45:23Z herbert $ \documentclass[11pt,english,BCOR10mm,DIV12,bibliography=totoc,parskip=false,smallheadings headexclude,footexclude,oneside]{pst-doc} \listfiles @@ -254,9 +254,135 @@ for the horizontal line in \Lkeyval{psMarkAngleLineStyle} and preset to \end{pspicture} \end{lstlisting} +All end points of the vectors are saved in node names with the preset name \verb=Vector#=, +where \# is the consecutive number of the nodes. \verb=Vector0= ist the starting point of +the first \Lcs{psVector}. With the macro \Lcs{psStartPoint} one can set the starting point and +with optional argument the name of the nodes. \verb=Vector3= is the default node name of +the endpoint of the third vector or the name of the starting point of the forth vector. + +\begin{BDef} +\Lcs{psStartPoint}\OptArg{node basename}\Largr{$x$,$y$} +\end{BDef} + +\begin{pspicture}[showgrid,linewidth=1pt](10,10.4) + \psStartPoint[A](1,1)% nodes have the base name A + \psVector(3;30)\psVector(4;60)\psVector[linecolor=red](3;10) + \psVector[linestyle=dashed](4;110) + \psline{->}(A0)(A4) + \psStartPoint[B](1,1)\psset{markAngle}% nodes have the base name B + \psVector[linestyle=dashed](4;110) + \psVector[linecolor=red](3;10) + \psVector(4;60)\psVector(3;30) + \psline[arrows=-D>,arrowscale=2,linewidth=1.5pt,linecolor=red](B2)(A2) + \psline[arrows=-D>,arrowscale=2,linewidth=1.5pt,linecolor=blue](A3)(B3) + \multido{\iA=0+1}{5}{\uput[0](A\iA){A\iA}\uput[180](B\iA){B\iA}} +\end{pspicture} + +\begin{lstlisting} +\begin{pspicture}[showgrid,linewidth=1pt](10,10.4) + \psStartPoint[A](1,1)% nodes have the base name A + \psVector(3;30)\psVector(4;60)\psVector[linecolor=red](3;10) + \psVector[linestyle=dashed](4;110) + \psline{->}(A0)(A4) + \psStartPoint[B](1,1)\psset{markAngle}% nodes have the base name B + \psVector[linestyle=dashed](4;110) + \psVector[linecolor=red](3;10) + \psVector(4;60)\psVector(3;30) + \psline[arrows=-D>,arrowscale=2,linewidth=1.5pt,linecolor=red](B2)(A2) + \psline[arrows=-D>,arrowscale=2,linewidth=1.5pt,linecolor=blue](A3)(B3) + \multido{\iA=0+1}{5}{\uput[0](A\iA){A\iA}\uput[180](B\iA){B\iA} + \end{pspicture} +\end{lstlisting} \clearpage + +%-------------------------------------------------------------------------------------- +\section{\nxLcs{psCircleTangents}: Calculating tangent lines of circles} +%-------------------------------------------------------------------------------------- + +The macro calculates the points on a circle where tangent lines from another +point or another circle are drawn. + +\begin{BDef} +\Lcs{psCircleTangents}\Largr{$x1,y1$}\Largr{$x2,y2$}\Largb{Radius}\\ +\Lcs{psCircleTangents}\Largr{$x1,y1$}\Largb{Radius}\Largr{$x2,y2$}\Largb{Radius} +\end{BDef} + +In the first case the coordinates of a point and the center and the radius +of a circle must be given. The names of the calculates node names are \verb=CircleT1= +and \verb=CircleT2=. + +\bigskip +\begin{pspicture}[showgrid](0,3)(10,10) +\psdot(2,4)\pscircle(7,7){2} +\psCircleTangents(2,4)(7,7){2} +\pcline[nodesep=-1cm,linecolor=blue](2,4)(CircleT1) +\pcline[nodesep=-1cm,linecolor=blue](2,4)(CircleT2) +\psdots(CircleT1)(CircleT2) +\uput[-80](CircleT1){T1}\uput[115](CircleT2){T2} +\end{pspicture} + + +\begin{lstlisting} +\begin{pspicture}[showgrid](0,3)(10,10) +\psdot(2,4)\pscircle(7,7){2} +\psCircleTangents(2,4)(7,7){2} +\pcline[nodesep=-1cm,linecolor=blue](2,4)(CircleT1) +\pcline[nodesep=-1cm,linecolor=blue](2,4)(CircleT2) +\psdots(CircleT1)(CircleT2) +\uput[-80](CircleT1){T1}\uput[115](CircleT2){T2} +\end{pspicture} +\end{lstlisting} + +\bigskip +When using the other variant of the macro two circles must be given. THe macro then defines +ten nodes, named \verb=CircleTC1= and \verb=CircleTC2= for the two intersection points, + \verb=CircleTO1=, \verb=CircleTO2=, \verb=CircleTO3=, and \verb=CircleTO4= for the four + nodes of the outer tangent lines and + \verb=CircleTI1=, \verb=CircleTI2=, \verb=CircleTI3=, and \verb=CircleTI4= for the + four nodes of the inenr tangent lines. + +\bigskip +\begin{pspicture}[showgrid](-2,-2)(10,10) +\pscircle(1,1){1}\pscircle(7,7){3} +\psCircleTangents(1,1){1}(7,7){3} +\pcline[nodesep=-1cm,linecolor=blue](CircleTO1)(CircleTO2) +\pcline[nodesep=-1cm,linecolor=blue](CircleTO3)(CircleTO4) +\pcline[nodesep=-1cm,linecolor=red](CircleTI1)(CircleTI2) +\pcline[nodesep=-1cm,linecolor=red](CircleTI3)(CircleTI4) +\psdots(CircleTC1)(CircleTC2)% + (CircleTO1)(CircleTO2)(CircleTO3)(CircleTO4)% + (CircleTI1)(CircleTI2)(CircleTI3)(CircleTI4)% +\uput[0](CircleTC1){TC1}\uput[0](CircleTC2){TC2} +\uput[-80](CircleTI1){TI1}\uput[115](CircleTI2){TI2} +\uput[150](CircleTI3){TI3}\uput[-45](CircleTI4){TI4} +\uput[-80](CircleTO1){TO1}\uput[150](CircleTO2){TO2} +\uput[150](CircleTO3){TO3}\uput[-45](CircleTO4){TO4} +\end{pspicture} + +\bigskip +\begin{lstlisting} +\begin{pspicture}[showgrid](-2,-2)(10,10) +\pscircle(1,1){1}\pscircle(7,7){3} +\psCircleTangents(1,1){1}(7,7){3} +\pcline[nodesep=-1cm,linecolor=blue](CircleTO1)(CircleTO2) +\pcline[nodesep=-1cm,linecolor=blue](CircleTO3)(CircleTO4) +\pcline[nodesep=-1cm,linecolor=red](CircleTI1)(CircleTI2) +\pcline[nodesep=-1cm,linecolor=red](CircleTI3)(CircleTI4) +\psdots(CircleTC1)\psdots(CircleTC2)% + (CircleTO1)(CircleTO2)(CircleTO3)(CircleTO4)% + (CircleTI1)(CircleTI2)(CircleTI3)(CircleTI4)% +\uput[0](CircleTC1){TC1}\uput[0](CircleTC2){TC2} +\uput[-80](CircleTI1){TI1}\uput[115](CircleTI2){TI2} +\uput[150](CircleTI3){TI3}\uput[-45](CircleTI4){TI4} +\uput[-80](CircleTO1){TO1}\uput[150](CircleTO2){TO2} +\uput[150](CircleTO3){TO3}\uput[-45](CircleTO4){TO4} +\end{pspicture} +\end{lstlisting} + + +\clearpage %-------------------------------------------------------------------------------------- \section{\nxLcs{psrotate}: Rotating objects} %-------------------------------------------------------------------------------------- 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 3d2a9e33c44..1505289d7ed 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 431 2010-12-13 10:53:46Z herbert $ +%% $Id: pstricks-add.tex 439 2010-12-18 18:45:23Z herbert $ %% %% %% This is file `pstricks-add.tex', @@ -31,8 +31,8 @@ \ifx\PSTXKeyLoaded\endinput\else \input pst-xkey \fi \ifx\PSTmathLoaded\endinput\else \input pst-math \fi % -\def\fileversion{3.46} -\def\filedate{2010/12/13} +\def\fileversion{3.48} +\def\filedate{2010/12/18} \message{`pstricks-add' v\fileversion, \filedate\space (dr,hv)} % \edef\PstAtCode{\the\catcode`\@} \catcode`\@=11\relax @@ -2027,40 +2027,197 @@ dup #1Delta.X m 1 add get mul #1.X m get add #1Tick.X j 3 -1 roll put % s on sta \endgroup% } % +\newcount\psVectorCtr \define@boolkey[psset]{pstricks-add}[Pst@]{markAngle}[true]{} \psset[pstricks-add]{markAngle=false} \newpsstyle{psMarkAngleStyle}{arrows=->,arrowsize=4pt} \newpsstyle{psMarkAngleLineStyle}{linestyle=dotted,arrows=-} % -\def\psStartPoint(#1){\pst@getcoor{#1}\pst@tempA +\def\psStartPoint{\@ifnextchar[{\psStartPoint@i}{\psStartPoint@i[Vector]}} +\def\psStartPoint@i[#1](#2){% + \global\psVectorCtr=\@ne + \gdef\psVectorName{#1} + \pnode(#2){#10} + \pst@getcoor{#2}\pst@tempA% \pstVerb{tx@Dict begin \pst@tempA \pst@number\psyunit div /cp.Y exch def - \pst@number\psxunit div /cp.X exch def end - }} -\psStartPoint(0,0) + \pst@number\psxunit div /cp.X exch def end }} % -\def\psVector{\@ifnextchar[\psVector@i{\psVector@i[]}} -\def\psVector@i[#1](#2){% +\def\psVector{\pst@object{psVector}} +\def\psVector@i(#1){% \pst@killglue% - \pst@getcoor{#2}\pst@tempCoor% + \pst@getcoor{#1}\pst@tempCoor% + \addbefore@par{arrows=->,arrowsize=6pt}% \begingroup - \psset{arrows=->,arrowsize=6pt,#1}% + \use@par% \rput(! cp.X cp.Y ){% - \psline(0,0)(#2)% + \psline(0,0)(#1)% \ifPst@markAngle \psarc[style=psMarkAngleStyle](0,0){1}{0}{!\pst@tempCoor exch atan}% \psline[style=psMarkAngleLineStyle](1.5,0)% \fi}% + \pnode(! \pst@tempCoor \pst@number\psyunit div cp.Y add exch + \pst@number\psxunit div cp.X add exch ){\psVectorName\the\psVectorCtr}% + \global\advance\psVectorCtr by \@ne% \endgroup% - \pstVerb{tx@Dict begin + \pst@Verb{%tx@Dict begin \pst@tempCoor \pst@number\psyunit div cp.Y add /cp.Y exch def - \pst@number\psxunit div cp.X add /cp.X exch def end + \pst@number\psxunit div cp.X add /cp.X exch def %end }% \ignorespaces% } % +\def\psCircleTangents(#1){\@ifnextchar({\psCircleTangents@i(#1)}{\psCircleTangents@ii(#1)}} +\def\psCircleTangents@i(#1)(#2)#3{% point circle radius + \pst@killglue% + \begingroup% + \pst@getcoor{#1}\pst@CoorA% point + \pst@getcoor{#2}\pst@CoorB% circle + \pst@getlength{#3}\pst@LengthA% radius + \pst@Verb{ + 50 dict begin + \pst@CoorA \pst@number\psyunit div /Y1 ED % point + \pst@number\psxunit div /X1 ED + \pst@CoorB \pst@number\psyunit div /Y2 ED % circle + \pst@number\psxunit div /X2 ED + Y2 Y1 sub X2 X1 sub atan /Alpha ED + X1 Y1 X2 Y2 Pyth2 /distance ED + /m Alpha tan def + \pst@LengthA \pst@number\psrunit div /r1 ED +% we have the intersectionpoint of the inner tangents + /tangentAngle r1 distance div asin def + /negAngle Alpha tangentAngle sub def + /m2 negAngle tan def + /b Y1 m2 X1 mul sub def +% + /Z Y1 m2 X1 mul sub Y2 sub def + /k1 2 X2 mul 2 m2 mul Z mul sub 1 m2 dup mul add div neg def + k1 neg 2 div /x1 ED + /y1 m2 x1 mul b add def + /xS m X1 mul Y1 sub x1 m div add y1 add m 1 m div add div def + /yS m xS X1 sub mul Y1 add def + /x2 x1 2 xS x1 sub mul add def + /y2 y1 2 yS y1 sub mul add def +% + tx@NodeDict begin + { x1 \pst@number\psxunit mul y1 \pst@number\psyunit mul } false + /N@CircleT1 10 { InitPnode } NewNode + { x2 \pst@number\psxunit mul y2 \pst@number\psyunit mul } false + /N@CircleT2 10 { InitPnode } NewNode + end + end + }% + \endgroup% + \ignorespaces% +} +\def\psCircleTangents@ii(#1)#2(#3)#4{% two circles + \pst@killglue% + \begingroup% + \pst@getcoor{#1}\pst@CoorA% + \pst@getlength{#2}\pst@LengthA% + \pst@getcoor{#3}\pst@CoorB% + \pst@getlength{#4}\pst@LengthB% + \pst@Verb{ + 50 dict begin + \pst@CoorA \pst@number\psyunit div /Y1 ED + \pst@number\psxunit div /X1 ED + \pst@CoorB \pst@number\psyunit div /Y2 ED + \pst@number\psxunit div /X2 ED + Y2 Y1 sub X2 X1 sub atan /Alpha ED + X1 Y1 X2 Y2 Pyth2 /distance ED + /m Alpha tan def + \pst@LengthA \pst@number\psrunit div /r1 ED + \pst@LengthB \pst@number\psrunit div /r2 ED + distance r1 r1 r2 add div mul /d1 ED + d1 Alpha sin mul Y1 add /YQI ED + d1 Alpha cos mul X1 add /XQI ED + tx@NodeDict begin + { XQI \pst@number\psxunit mul YQI \pst@number\psyunit mul } false + /N@CircleTC1 10 { InitPnode } NewNode + end + /d2 distance d1 sub def +% we have the intersectionpoint of the inner tangents + /tangentAngle r2 d2 div asin def + /negAngle Alpha tangentAngle sub def + /m2 negAngle tan def + /b YQI m2 XQI mul sub def +% + /Z YQI m2 XQI mul sub Y2 sub def + /k1 2 X2 mul 2 m2 mul Z mul sub 1 m2 dup mul add div neg def + k1 neg 2 div /x1I ED + /y1I m2 x1I mul b add def + /xS m XQI mul YQI sub x1I m div add y1I add m 1 m div add div def + /yS m xS XQI sub mul YQI add def + /x2I x1I 2 xS x1I sub mul add def + /y2I y1I 2 yS y1I sub mul add def +% + /Z YQI m2 XQI mul sub Y1 sub def + /k1 2 X1 mul 2 m2 mul Z mul sub 1 m2 dup mul add div neg def + k1 neg 2 div /x1aI ED + /y1aI m2 x1aI mul b add def + /xS m XQI mul YQI sub x1aI m div add y1aI add m 1 m div add div def + /yS m xS XQI sub mul YQI add def + /x2aI x1aI 2 xS x1aI sub mul add def + /y2aI y1aI 2 yS y1aI sub mul add def + tx@NodeDict begin + { x1aI \pst@number\psxunit mul y1aI \pst@number\psyunit mul } false + /N@CircleTI1 10 { InitPnode } NewNode + { x1I \pst@number\psxunit mul y1I \pst@number\psyunit mul } false + /N@CircleTI2 10 { InitPnode } NewNode + { x2aI \pst@number\psxunit mul y2aI \pst@number\psyunit mul } false + /N@CircleTI3 10 { InitPnode } NewNode + { x2I \pst@number\psxunit mul y2I \pst@number\psyunit mul } false + /N@CircleTI4 10 { InitPnode } NewNode + end +% + /d1 distance r2 r1 div 1 sub div def + /tangentAngle r1 d1 div asin def + /negAngle Alpha tangentAngle sub def + /m2 negAngle tan def + /YQO Y1 d1 Alpha sin mul sub def + /XQO X1 d1 Alpha cos mul sub def + tx@NodeDict begin + { XQO \pst@number\psxunit mul YQO \pst@number\psyunit mul } false + /N@CircleTC2 10 { InitPnode } NewNode + end + % we have the new central point + /b YQO m2 XQO mul sub def + /Z YQO m2 XQO mul sub Y1 sub def + /k1 2 X1 mul 2 m2 mul Z mul sub 1 m2 dup mul add div neg def + k1 neg 2 div /x1O ED + /y1O m2 x1O mul b add def + /xS m XQO mul YQO sub x1O m div add y1O add m 1 m div add div def + /yS m xS XQO sub mul YQO add def + /x2O x1O 2 xS x1O sub mul add def + /y2O y1O 2 yS y1O sub mul add def +% + /Z YQO m2 XQO mul sub Y2 sub def + /k1 2 X2 mul 2 m2 mul Z mul sub 1 m2 dup mul add div neg def + k1 neg 2 div /x1aO ED + /y1aO m2 x1aO mul b add def + /xS m XQO mul YQO sub x1aO m div add y1aO add m 1 m div add div def + /yS m xS XQO sub mul YQO add def + /x2aO x1aO 2 xS x1aO sub mul add def + /y2aO y1aO 2 yS y1aO sub mul add def +% + tx@NodeDict begin + { x1aO \pst@number\psxunit mul y1aO \pst@number\psyunit mul } false + /N@CircleTO1 10 { InitPnode } NewNode + { x1O \pst@number\psxunit mul y1O \pst@number\psyunit mul } false + /N@CircleTO2 10 { InitPnode } NewNode + { x2aO \pst@number\psxunit mul y2aO \pst@number\psyunit mul } false + /N@CircleTO3 10 { InitPnode } NewNode + { x2O \pst@number\psxunit mul y2O \pst@number\psyunit mul } false + /N@CircleTO4 10 { InitPnode } NewNode + end + end + }% + \endgroup% + \ignorespaces% +} +% \def\resetOptions{% \def\pst@linetype{0}% \pstScalePoints(1,1){}{}% |