diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /graphics/pstricks/contrib/pst-coil |
Initial commit
Diffstat (limited to 'graphics/pstricks/contrib/pst-coil')
-rw-r--r-- | graphics/pstricks/contrib/pst-coil/Changes | 35 | ||||
-rw-r--r-- | graphics/pstricks/contrib/pst-coil/README | 12 | ||||
-rw-r--r-- | graphics/pstricks/contrib/pst-coil/doc/pst-coil-doc.bib | 166 | ||||
-rw-r--r-- | graphics/pstricks/contrib/pst-coil/doc/pst-coil-doc.pdf | bin | 0 -> 295379 bytes | |||
-rw-r--r-- | graphics/pstricks/contrib/pst-coil/doc/pst-coil-doc.tex | 580 | ||||
-rw-r--r-- | graphics/pstricks/contrib/pst-coil/dvips/pst-coil.pro | 131 | ||||
-rw-r--r-- | graphics/pstricks/contrib/pst-coil/latex/pst-coil.sty | 13 | ||||
-rw-r--r-- | graphics/pstricks/contrib/pst-coil/tex/pst-coil.tex | 227 |
8 files changed, 1164 insertions, 0 deletions
diff --git a/graphics/pstricks/contrib/pst-coil/Changes b/graphics/pstricks/contrib/pst-coil/Changes new file mode 100644 index 0000000000..d9028ebf31 --- /dev/null +++ b/graphics/pstricks/contrib/pst-coil/Changes @@ -0,0 +1,35 @@ +pst-coil.sty -------- + 2010-02-01 message for loading the pro file + +pst-coil.tex -------- +v. 1.07 2015-05-13 - modified psSin +v. 1.06 2011-09-18 - fix bug with \pszigzag +v. 1.05 2011-07-12 - added optional argument bow for circular + zigzags +v. 1.04 2010-02-02 - allow an absolute value for the period + with a rounding or truncating option +v. 1.03 2010-02-01 - allow an absolute value for the period + with a rounding option +v. 1.02 2010-01-31 - allow an absolute value for the period + - rename option frequency to period +v. 1.01 2010-01-30 added \pcsin and ncsin for trigonometrial + functions which connect two nodes +v. 1.00 2006-08-11 using pst-xkey for the key handling + +pst-coil.pro -------- +v. 1.07 2015-05-13 - modified function Sin +v. 1.05 2011-07-12 - added circular function +v. 1.04 2010-02-02 - allow an absolute value for the period + with a rounding or truncating option +v. 1.03 2010-02-01 - allow an absolute value for the period + with a rounding option +v. 1.02 2010-01-31 - allow an absolute value for the period + - rename option frequency to period +v. 1.01 2010-01-30 added subroutine Sin for trigonometrial + functions which connect two nodes +v. 1.00 2006-11-05 small tweaks to the code + + +pst-coil-doc.tex -------- +v. 1.01 2010-01-30 update +v. 1.00 2006-08-11 new documentation diff --git a/graphics/pstricks/contrib/pst-coil/README b/graphics/pstricks/contrib/pst-coil/README new file mode 100644 index 0000000000..8f8b07cfa0 --- /dev/null +++ b/graphics/pstricks/contrib/pst-coil/README @@ -0,0 +1,12 @@ +pst-coil: coils zigzags and coils connections + +pst-coil.sty - The LaTeX file +pst-coil.tex - The TeX file +pst-coil.pro - The dvips header file +pst-coil-doc.pdf - The documentation +pst-coil-doc.tex - The documentation, source +pst-coil-doc.bib - The documentation, bibfile + + +-- +Herbert Voss 2006-11-05 diff --git a/graphics/pstricks/contrib/pst-coil/doc/pst-coil-doc.bib b/graphics/pstricks/contrib/pst-coil/doc/pst-coil-doc.bib new file mode 100644 index 0000000000..b29fe53b65 --- /dev/null +++ b/graphics/pstricks/contrib/pst-coil/doc/pst-coil-doc.bib @@ -0,0 +1,166 @@ +@STRING{tugboat = {TUGboat} } +@STRING{beiprogramm = {{\TeX}-Beiprogramm} } +@STRING{bretter = {Bretter, die die Welt bedeuten} } +@STRING{dtk = {{D}ie {\TeX}nische {K}om{\"o}die} } +@STRING{editorial = {Editorial} } +@STRING{fremdebuehne = {Von fremden B{\"u}hnen} } +@STRING{fundus = {Aus dem Fundus} } +@STRING{hinterbuehne = {Hinter der B{\"u}hne} } +@STRING{leserbrief = {Leserbrief(e)} } +@STRING{magazin = {Magazin} } +@STRING{rezension = {Rezensionen} } +@STRING{schonimmer = {Was Sie schon immer {\"u}ber {\TeX} wissen wollten \dots} } +@STRING{theaterkasse = {Von der Theaterkasse} } +@STRING{theatertage = {{\TeX}-Theatertage} } + +@Article{ dtk02.2:jackson.voss:plot-funktionen, + author = {Laura E. Jackson and Herbert Vo{\ss}}, + title = {Die {P}lot-{F}unktionen von {\texttt{pst-plot}}}, + journal = dtk, + year = 2002, + volume = {2/02}, + altvolume = 2, + altnumber = 14, + month = jun, + pages = {27--34}, + annote = bretter, + keywords = {}, + abstract = { Im letzten Heft wurden die mathematischen Funktionen von + \PS~im Zusammenhang mit dem {\LaTeX}-Paket + \texttt{pst-plot} zum Zeichnen von Funktionen beschrieben + und durch Beispiele erl{\"a}utert. In diesem Teil werden + die bislang nur erw{\"a}hnten Plot-Funktionen f{\"u}r + externe Daten behandelt. } +} + +@Article{ dtk02.1:voss:mathematischen, + author = {Herbert Vo{\ss}}, + title = {Die mathematischen {F}unktionen von {P}ost{S}cript}, + journal = dtk, + year = 2002, + volume = {1/02}, + altvolume = 1, + altnumber = 14, + month = mar, + pages = {}, + annote = bretter, + keywords = {}, + abstract = { \PS, faktisch genauso alt wie {\TeX}, ist im + Verh{\"a}ltnis dazu allgemein noch weniger bekannt, wenn es + darum geht zu beurteilen, was es denn nun im eigentlichen + Sinne ist. Au{\ss}erdem wird h{\"a}ufig vergessen, dass + sich mit den \PS-Funktionen viele Dinge erledigen lassen, + bei denen sonst auf externe Programme zur{\"u}ckgegriffen + wird. Dies wird im Folgenden f{\"u}r die mathematischen + Funktionen im Zusammenhang mit dem Paket \texttt{pst-plot} + gezeigt. } +} + +@Book{tlgc2, + author = {Michel Goosens and Frank Mittelbach and Sebastian Rahtz and Denis Roegel and Herbert Vo{\ss}}, + title = {The {\LaTeX} {G}raphics {C}ompanion}, + publisher = {{Addison-Wesley Publishing Company}}, + edition = second, + year = {2007}, + address = {Reading, Mass.} +} + + +@Book{voss:chaos, + author = {Herbert Vo{\ss}}, + title = {Chaos und {F}raktale selbst programmieren: von {M}andelbrotmengen + {\"u}ber {F}arbmanipulationen zur perfekten Darstellung}, + publisher = {{Franzis Verlag}}, + year = {1994}, + address = {Poing} +} + +@Article{girou:01:, + author = {Denis Girou}, + title = {Pr\'esentation de {PST}ricks}, + journal = {Cahier {GUT}enberg}, + year = 1994, + volume = {16}, + month = apr, + pages = {21-70} +} + +@Article{girou:02:, + author = {{Timothy van} Zandt and Denis Girou}, + title = {Inside {PST}ricks}, + journal = TUGboat, + year = 1994, + volume = {15}, + month = sep, + pages = {239-246} +} + +@Book{PostScript, + Author = {Kollock, Nikolai G.}, + Title = {Post{S}cript richtig eingesetzt: vom {K}onzept zum + praktischen {E}insatz}, + Publisher = {IWT}, + Address = {Vaterstetten}, + year = 1989, +} + +@Manual{pstricks, + Title = {PSTricks - {\PS} macros for generic {\TeX}}, + Author = {{Timothy van} Zandt}, + Organization = {}, + Address = {\url{http://www.tug.org/application/PSTricks}}, + Note = {}, + year = 1993 +} + +@Manual{pst-plot, + Title = {\texttt{pst-plot}: Plotting two dimensional functions and data}, + Author = {{Timothy van} Zandt}, + Organization = {}, + Address = {\url{CTAN:graphics/pstricks/generic/pst-plot.tex}}, + Note = {}, + year = 1999 +} + +@Manual{multido, + Title = {\texttt{multido.tex} - a loop macro, that supports fixed-point addition}, + Author = {{Timothy van} Zandt}, + Organization = {}, + Address = {\url{CTAN:/graphics/pstricks/generic/multido.tex}}, + Note = {}, + year = 1997 +} + +@Book{PSTricks2, + author = {Herbert Vo\ss}, + title = {\texttt{PSTricks} -- {G}rafik f\"ur \TeX{} und \LaTeX}, + edition = {6.}, + publisher = {DANTE -- Lehmanns}, + year = {2010}, + address = {Heidelberg/Berlin} +} + +@Book{voss:math, + author = {Herbert Vo\ss}, + title = {Typesetting mathematics with \LaTeX}, + publisher = {UIT}, + year = {2010}, + address = {Cambridge} +} + +@Book{PSTricks2-UIT, + author = {Herbert Vo\ss}, + title = {PSTricks -- Graphics for \TeX\ and \LaTeX}, + publisher = {UIT}, + year = {2011}, + address = {Cambridge} +} + +@Book{LaTeXRef-UIT, + author = {Herbert Vo\ss}, + title = {{\LaTeX} quick reference}, + publisher = {UIT}, + year = {2012}, + address = {Cambridge} +} + diff --git a/graphics/pstricks/contrib/pst-coil/doc/pst-coil-doc.pdf b/graphics/pstricks/contrib/pst-coil/doc/pst-coil-doc.pdf Binary files differnew file mode 100644 index 0000000000..26f0e655ba --- /dev/null +++ b/graphics/pstricks/contrib/pst-coil/doc/pst-coil-doc.pdf diff --git a/graphics/pstricks/contrib/pst-coil/doc/pst-coil-doc.tex b/graphics/pstricks/contrib/pst-coil/doc/pst-coil-doc.tex new file mode 100644 index 0000000000..201f8298c0 --- /dev/null +++ b/graphics/pstricks/contrib/pst-coil/doc/pst-coil-doc.tex @@ -0,0 +1,580 @@ +%% $Id: pst-coil-doc.tex 539 2011-07-12 08:22:33Z herbert $ +\documentclass[11pt,english,BCOR10mm,DIV12,bibliography=totoc,parskip=false,smallheadings + headexclude,footexclude,oneside,dvipsnames,svgnames]{pst-doc} +\listfiles + +\usepackage[utf8]{inputenc} +\usepackage{pst-plot,pst-node,pst-coil} +\SpecialCoor +\let\pstFV\fileversion +\let\belowcaptionskip\abovecaptionskip +% +\def\bgImage{% +\begin{pspicture}(6,2) + \cnode*(0,1){4pt}{A}\cnode*(6,1){4pt}{B} + \pcsin[linecolor=red,amplitude=0.75,periods=20,function=dup 0.1 mul sin exch cos add](A)(B) +\end{pspicture} +} +\lstset{explpreset={pos=l,width=-99pt,overhang=0pt,hsep=\columnsep,vsep=\bigskipamount,rframe={}}, + escapechar=?} +\def\textat{\char064}% + +\begin{document} +\title{\texttt{pst-coil}\\Special node connections \\\small v.\pstFV} +\docauthor{Herbert Vo\ss} +\author{Timothy Van Zandt\\Herbert Vo\ss\\Michael Sharpe} +\date{\today} + +\maketitle + +\begin{abstract} +Coils, springs and zigzag curves +do not really count to the ordinary when creating graphics. They are of some +importance though when dealing with the creation of coilish connections. They +can also be used for node connections which will be shown +at the end of this chapter. + +The parameters especially for the \verb+coil+ variants are only easy to +understand when keeping in mind that three dimensional helixes are dealt with, +which are only projected onto the two dimensional paper plane. This will be +elaborated on at the corresponding places. + +\vfill +\noindent +Thanks to: +Marco Daniel, Denis Girou, Uwe Siart. +\end{abstract} + +\clearpage +\tableofcontents + +\clearpage +% --------------------------------------------------------------------------------------- +\section{Parameters}\label{sec:pstcoil:parameter} +% --------------------------------------------------------------------------------------- +Table~\ref{tab:pst-coil:parameter} shows a compilation of the special parameters +valid for \LPack{pst-coil}. + +\begin{table}[!htb] +\caption{Compilation of all parameters for \texttt{pst-coil}}\label{tab:pst-coil:parameter} +\centering +\begin{tabular}{@{}>{\ttfamily}l>{\ttfamily}l>{\ttfamily}l@{}}\toprule +\textrm{name} & \textrm{value} & \textrm{default}\\\midrule +\Lkeyword{coilwidth} & <value[unit]> & 1cm\\ +\Lkeyword{coilheight} & <value> & 1\\ +\Lkeyword{coilarm} & <value[unit]> & 0.5cm\\ +\Lkeyword{coilarmA} & <value[unit]> & 0.5cm\\ +\Lkeyword{coilarmB} & <value[unit]> & 0.5cm\\ +\Lkeyword{coilaspect} & <angle> & 45\\ +\Lkeyword{coilinc} & <angle> & 45\\ +\Lkeyword{periods} & <value> & 1\\ +\Lkeyword{amplitude} & <value> & 1\\ +\Lkeyword{function} & <PS code> & sin\\ +\Lkeyword{ppoints} & <dots per periods> & 360\\ +\Lkeyword{bow} & <value[unit]> & 0cm\\\bottomrule +\end{tabular} +\end{table} + +% --------------------------------------------------------------------------------------- +\subsection{\texttt{coilwidth}}\label{subsec:pstcoil:coilwidth} +% --------------------------------------------------------------------------------------- +\Lkeyword{coilwidth} denotes the diameter\index{diameter} of the +coil resp. the height of a zigzag line\index{zigzag line}\index{coil}. The +diameter corresponds to the height with a perpendicular parallel projection +transverse to the length. + +\medskip\noindent +\begin{minipage}[t]{5cm}\vspace{0pt} +\begin{pspicture}(0,-5)(5,5) +\pscoil(0,4)(3.5,4) +{ +\psset{linewidth=0.2pt} +\psline[arrowscale=2,tbarsize=3mm]{|<->|}(4.5,3.5)(4.5,4.5) +\psline[linestyle=dashed](3.25,4.5)(4.5,4.5) +\psline[linestyle=dashed](2.75,3.5)(4.5,3.5) +} +\uput*[0](3.5,4){coilwidth} +\pscoil[coilwidth=0.75cm](0,2.6)(3.6,2.6) +\uput*[0](3.5,2.6){0.75cm} +\pscoil[coilwidth=0.5cm](0,1.8)(3.5,1.8) +\uput*[0](3.5,1.8){0.50cm} +\pscoil[coilwidth=0.25cm](0,1.2)(3.5,1.2) +\uput*[0](3.5,1.2){0.25cm} +\pscoil*[coilwidth=0.5cm](0,0.5)(3.5,0.5) +\uput*[0](3.5,0.5){0.50cm} +% zigzag +\pszigzag(0,-4)(3.5,-4) +{ +\psset{linewidth=0.2pt} +\psline[arrowscale=2,tbarsize=3mm]{|<->|}(4.5,-3.5)(4.5,-4.5) +\psline[linestyle=dashed](3.25,-4.5)(4.5,-4.5) +\psline[linestyle=dashed](2.75,-3.5)(4.5,-3.5) +} +\uput*[0](3.5,-4){coilwidth} +\pszigzag[coilwidth=0.75cm](0,-2.6)(3.6,-2.6) +\uput*[0](3.5,-2.6){0.75cm} +\pszigzag[coilwidth=0.5cm](0,-1.8)(3.5,-1.8) +\uput*[0](3.5,-1.8){0.50cm} +\pszigzag[coilwidth=0.25cm](0,-1.2)(3.5,-1.2) +\uput*[0](3.5,-1.2){0.25cm} +\pszigzag*[coilwidth=0.5cm](0,-0.5)(3.5,-0.5) +\uput*[0](3.5,-0.5){0.50cm} +\end{pspicture} +\end{minipage}\hfill% +\begin{minipage}[t]{\linewidth-5cm-1em}\vspace{0pt} +\begin{lstlisting} +\begin{pspicture}(0,-5)(5,5) +\pscoil(0,4)(3.5,4) +{\psset{linewidth=0.2pt} +\psline[arrowscale=2,tbarsize=3mm]{|<->|}(4.5,3.5)(4.5,4.5) +\psline[linestyle=dashed](3.25,4.5)(4.5,4.5) +\psline[linestyle=dashed](2.75,3.5)(4.5,3.5)} +\uput*[0](3.5,4){coilwidth} +\pscoil[coilwidth=0.75cm](0,2.6)(3.6,2.6) +\uput*[0](3.5,2.6){0.75cm} +\pscoil[coilwidth=0.5cm](0,1.8)(3.5,1.8) +\uput*[0](3.5,1.8){0.50cm} +\pscoil[coilwidth=0.25cm](0,1.2)(3.5,1.2) +\uput*[0](3.5,1.2){0.25cm} +\pscoil*[coilwidth=0.5cm](0,0.5)(3.5,0.5) +\uput*[0](3.5,0.5){0.50cm} +% zigzag +\pszigzag(0,-4)(3.5,-4) + +[ ... ] +\end{lstlisting} +\end{minipage} + + + +% --------------------------------------------------------------------------------------- +\subsection{\texttt{coilheight}}\label{subsec:pstcoil:coilheight} +% --------------------------------------------------------------------------------------- +\Lkeyword{coilheight} is in contrast to \Lkeyword{coilwidth} no +length but only a factor, whereat the distance between two +windings\index{winding} resp. jags is composed as follows: +$dx = coilheight\cdot coilwidth$ + + +\medskip\noindent +\begin{LTXexample}[width=5cm] +\begin{pspicture}(0,-3)(5,4) +\pscoil(0,4)(3.5,4) +{\psset{linewidth=0.2pt} +\psline[arrowscale=2,tbarsize=3mm]{|<->|}(4.5,3.5)(4.5,4.5) +\psline[linestyle=dashed](3.25,4.5)(4.5,4.5) +\psline[linestyle=dashed](2.75,3.5)(4.5,3.5) +\psline[arrowscale=2,tbarsize=3mm]{|<->|}(1.75,3.2)(2.5,3.2) +\uput[-90](2.15,3){\footnotesize\texttt{coilheight$\times$coilwidth}}} +\uput*[0](3.5,4){coilwidth} +\pscoil[coilheight=0.75](0,1.5)(3.6,1.5) +\uput*[0](3.5,1.5){0.75} +\pscoil[coilheight=0.5](0,0)(3.5,0) +\uput*[0](3.5,0){0.50} +\pscoil[coilheight=1.25](0,-1.5)(3.5,-1.5) +\uput*[0](3.5,-1.5){1.25} +\pscoil*[coilheight=0.5](0,-3)(3.5,-3) +\uput*[0](3.5,-3){0.50} +\end{pspicture} +\end{LTXexample} + +\vspace{0pt}\noindent +\begin{LTXexample}[width=5cm] +\begin{pspicture}[shift=2cm](0,-3)(5,4) +\pszigzag(0,4)(3.5,4) +{ \psset{linewidth=0.2pt} +\psline[arrowscale=2,tbarsize=3mm]{|<->|}(4.5,3.5)(4.5,4.5) +\psline[linestyle=dashed](2.5,4.5)(4.5,4.5) +\psline[linestyle=dashed](2.75,3.5)(4.5,3.5) +\psline[arrowscale=2,tbarsize=3mm]{|<->|}(1.75,3.2)(2.75,3.2) +\uput[-90](2.15,3){\footnotesize\texttt{coilheight$\times$coilwidth}} } +\uput*[0](3.5,4){coilwidth} +\pszigzag[coilheight=0.75](0,1.5)(3.6,1.5) +\uput*[0](3.5,1.5){0.75} +\pszigzag[coilheight=0.5](0,0)(3.5,0) +\uput*[0](3.5,0){0.50} +\pszigzag[coilheight=1.25](0,-1.5)(3.5,-1.5) +\uput*[0](3.5,-1.5){1.25} +\pszigzag*[coilheight=0.5](0,-3)(3.5,-3) +\uput*[0](3.5,-3){0.50} +\end{pspicture} +\end{LTXexample} + +\bigskip +As can be seen in the above example, not the same physical distance is +yielded. This is caused by the internal three dimensional +representation\index{three dimensional representation} of the coil; it is not +seen under an angle of $90^\circ$ but $45^\circ$. (Section~\ref{subsec:pstcoil:coilaspect}) + + +% --------------------------------------------------------------------------------------- +\subsection{\texttt{coilarm}, \texttt{coilarmA} and \texttt{coilarmB}}\label{subsec:pstcoil:coilarm} +% --------------------------------------------------------------------------------------- +\Lkeyword{coilarm}, \Lkeyword{coilarmA}, and \Lkeyword{coilarmB} denotes the +part of a straight line made left and right. Negative values are possible, but +do not make a lot of sense as a rule. As can be gathered from the example, the +coil is lenghtened by a negative value in this case, so that the part of a +straight line is led back to the specified starting point resp. endpoint and +consequently has a negative ``direction''{}. This parameter is not available for +\Lcs{psCoil}. + +\medskip\noindent +\begin{LTXexample}[width=4cm] +\begin{pspicture}(4,4.5) +\pscoil(0,4)(4,4) +\psset{coilwidth=0.5} +\pscoil[coilarm=0](0,3)(4,3) +\pscoil[coilarmA=1cm,coilarmB=0.2cm](0,2)(4,2) +\pscoil[coilarm=-10pt](0,1)(4,1) +\end{pspicture} +\end{LTXexample} + +\medskip\noindent +\begin{LTXexample}[width=4cm] +\begin{pspicture}(4,4.5) +\pszigzag(0,4)(4,4) +\psset{coilwidth=0.5} +\pszigzag[coilarm=0](0,3)(4,3) +\pszigzag[coilarmA=1cm,coilarmB=0.2cm](0,2)(4,2) +\pszigzag[coilarm=-10pt](0,1)(4,1) +\end{pspicture} +\end{LTXexample} + + + +% --------------------------------------------------------------------------------------- +\subsection{\texttt{coilaspect}}\label{subsec:pstcoil:coilaspect} +% --------------------------------------------------------------------------------------- +In Section~\ref{subsec:pstcoil:coilheight} the three +dimensional representation of the coil has been pointed out already. If it was +regarded right-angled to its axis, the windings would not be recognizable. With +\Lkeyword{coilaspect} this ``perspective''{} can be influenced, which is only +possible for the ``coil''{} variants of course. \Lkeyword{coilaspect}=0 yields a +sine curve. + +\medskip\noindent +\begin{LTXexample}[width=4cm] +\begin{pspicture}(4,4.5) +\pscoil(0,4)(4,4) +\psset{coilwidth=0.75} +\pscoil[coilaspect=0](0,3)(4,3) +\pscoil[coilaspect=30,coilheight=0.3](0,2)(4,2) +\pscoil[coilaspect=-30,coilheight=0.3](0,1)(4,1) +\end{pspicture} +\end{LTXexample} + + +% --------------------------------------------------------------------------------------- +\subsection{\texttt{coilinc}}\label{subsec:pstcoil:coilinc} +% --------------------------------------------------------------------------------------- +The curve is drawn with the \Lps{lineto} procedure of \PS, +whereat \Lkeyword{coilinc} specifies the rotation angle in the angular measure at +which the next point is calculated. It has already been mentioned that the +calculation is done as a three dimensional coil and is projected onto the two +dimensional plane only in the end. + +\Lkeyword{coilinc} does also not make sense for zigzag lines, so that this parameter +again only is available for the \Lkeyword{coil} variant. Large angles result in a +polygon line, small angles in harmonic progressions with increased calculation +effort. + +\medskip\noindent +\begin{LTXexample}[width=4cm] +\begin{pspicture}(4,4.5) +\psset{coilwidth=0.8} +\pscoil(0,4)(4,4) +\psset{coilinc=0} +\pscoil[coilinc=5](0,3)(4,3) +\pscoil[coilinc=30](0,2)(4,2) +\pscoil[coilinc=60](0,1)(4,1) +\end{pspicture} +\end{LTXexample} + + +% --------------------------------------------------------------------------------------- +\subsection{\texttt{bow}}\label{subsec:pstcoil:bow} +% --------------------------------------------------------------------------------------- +The default value for \Lkeyword{bow} is 0pt which leads to the shown direct connections +between the two given point. With a positive or negative value circular zigzags are +possible. This option is not available for coils. + +\medskip\noindent +\begin{LTXexample}[width=6cm] +\psset{unit=0.6} +\begin{pspicture}[showgrid,shift=2cm](-1,-1)(9,9) +\pszigzag[bow=-0.4cm,coilheight=.3, + coilwidth=.75cm]{*->}(0,0)(4,4) +\pczigzag[linecolor=red,bow=2.5cm, + coilheight=0.3, + coilwidth=.75cm]{*->}(0,2)(6,6) +\pnode(3,5){A}\pnode(5,0){B} +\nczigzag[bow=2cm, + coilheight=0.3,]{A}{B} +\end{pspicture} +\end{LTXexample} + +\vspace{2\normalbaselineskip} +% --------------------------------------------------------------------------------------- +\subsection{\nxLkeyword{ppoints}} +% --------------------------------------------------------------------------------------- +By default a line or node connection divides the total length into 360 segments. +This should be increased for long distances or a large number of periodss. + +\medskip\noindent +\begin{LTXexample}[width=5.5cm] +\begin{pspicture}(5,2) +\pssin[ppoints=2000, + periods=30](0,1)(5,1) +\end{pspicture} +\end{LTXexample} + + +% --------------------------------------------------------------------------------------- +\subsection{\nxLkeyword{periods}} +% --------------------------------------------------------------------------------------- +The line from A to B is plotted by default as one period, which is the same as the relative +\Lkeyword{periods}=1. A setting of \Lkeyword{periods}=3.3 plots the function 3.3 times +for the given length. + +\medskip\noindent +\begin{LTXexample}[width=5.5cm] +\begin{pspicture}(5,2) +\pssin[linecolor=blue](0,1)(5,1) +\pssin[periods=3.3](0,1)(5,1) +\end{pspicture} +\end{LTXexample} + +A value without an unit for the period is always relative, with an unit it will +be an absolute value. + +\medskip\noindent +\begin{LTXexample}[width=5.5cm] +\begin{pspicture}(5,2) +\psaxes(5mm,0)(4.5,2) +\psset{coilarm=5mm} +\pssin[linecolor=blue](0,1)(5,1) +\pssin[periods=1cm](0,1)(5,1) +\pssin[periods=2cm,linestyle=dashed](0,1)(5,1) +\end{pspicture} +\end{LTXexample} + +With a star as prefix the absolute real value will be truncated to get an +integer number of periods. + +\medskip\noindent +\begin{LTXexample}[width=5.5cm] +\begin{pspicture}(5,2) +\psset{coilarm=5mm} +\psaxes(5mm,0)(4.5,2) +\pssin[periods=1.1cm,linestyle=dotted, + linecolor=red](0,1)(5,1) +\pssin[periods=*1.1cm,linecolor=red](0,1)(5,1) +\pssin[periods=2.2cm,linestyle=dotted, + linecolor=blue](0,1)(5,1) +\pssin[periods=*2.2cm,linecolor=blue](0,1)(5,1) +\end{pspicture} +\end{LTXexample} + +With a double star as prefix the absolute real value will be rounded instead of truncated to get an +integer number of periods. + +\medskip\noindent +\begin{LTXexample}[width=5.5cm] +\begin{pspicture}(5,2) +\psset{coilarm=5mm} +\psaxes(5mm,0)(4.5,2) +\pssin[periods=1.1cm,linestyle=dotted, + linecolor=red](0,1)(5,1) +\pssin[periods=**1.1cm,linecolor=red](0,1)(5,1) +\pssin[periods=2.2cm,linestyle=dotted, + linecolor=blue](0,1)(5,1) +\pssin[periods=**2.2cm,linecolor=blue](0,1)(5,1) +\end{pspicture} +\end{LTXexample} + + +% --------------------------------------------------------------------------------------- +\subsection{\nxLkeyword{amplitude}} +% --------------------------------------------------------------------------------------- +As usual the \Lkeyword{amplitude} is the maximum of the plotted curve and preset to +\Lcs{psyunit}, eg 1cm. + +\medskip\noindent +\begin{LTXexample}[width=5.5cm] +\begin{pspicture}(5,2) +\pssin[linecolor=blue](0,1)(5,1) +\pssin[amplitude=0.5, + linecolor=red](0,1)(5,1) +\end{pspicture} +\end{LTXexample} + +% --------------------------------------------------------------------------------------- +\subsection{\nxLkeyword{function}} +% --------------------------------------------------------------------------------------- +By default the curve is plotted as $y=sin(x)$, The optional argument \Lkeyword{function} allows +to define any other object in \PS\ notation. The value of the variable $x$ is already on the stack! +The following example plots the defualt curve and one with the function $y=cos(x\cdot\sin(x))$: + +\medskip\noindent +\begin{LTXexample}[pos=t] +\begin{pspicture}(\linewidth,2) +\pssin[linecolor=blue](0,1)(\linewidth,1) +\pssin[function=dup sin mul cos, + linecolor=red,ppoints=10000, + periods=6](0,1)(\linewidth,1) +\end{pspicture} +\end{LTXexample} + +% --------------------------------------------------------------------------------------- +\section{Makros}\label{sec:pstcoil:makros} +% --------------------------------------------------------------------------------------- +\LPack{pst-coil} defines three macros, which make the creation of coil or zigzag +shaped lines possible.\index{zigzag line} + +\begin{BDef} +\LcsStar{pscoil}\OptArgs\OptArg*{\Largb{arrows}}\OptArg*{\coord0}\coord1\\ +\LcsStar{psCoil}\OptArgs\Largb{angle1}\Largb{angle2}\\ +\LcsStar{pszigzag}\OptArgs\OptArg*{\Largb{arrows}}\OptArg*{\coord0}\coord1\\ +\LcsStar{pssin}\OptArgs\OptArg*{\Largb{arrows}}\OptArg*{\coord0}\coord1 +\end{BDef} + +\begin{itemize} +\item If only one coordinate pair is specified, the first point is automatically + set to the origin of ordinates $(0,0)$. +\item Arrows may be set with the own parameter or with the optional parameter + with \Lkeyword{arrows}\texttt{=<\ldots-\ldots>}. +\item For \Lcs{psCoil} the coils are principally drawn without ``arms''{}. +\end{itemize} + + +The asterisk version are in principle pointless, since they do not allow a +meaningful representation. Some could be seen with the description of +parameters, but will not be described further in the following. + + +% --------------------------------------------------------------------------------------- +\subsection{\nxLcs{pscoil}}\label{subsec:pstcoil:pscoil} +% --------------------------------------------------------------------------------------- +Since \Lcs{pscoil} is nothing else than a polygon line, also all parameters are +available which apply for lines. + +\medskip\noindent +\begin{LTXexample}[width=4cm] +\begin{pspicture}(4,4) +\pscoil[coilarm=.5cm,linewidth=1.5pt,coilwidth=.5cm]{|->}(4,3) +\pscoil[linecolor=red,coilheight=0.25](3,4)(3,1) +\pscoil[doubleline=true,linecolor=cyan,coilheight=0.75](0,4)(3,0) +\end{pspicture} +\end{LTXexample} + +% --------------------------------------------------------------------------------------- +\subsection{\nxLcs{psCoil}}\label{subsec:pstcoil:psCoil} +% --------------------------------------------------------------------------------------- +\Lcs{psCoil} draws starting at the current point to the angle $\alpha$ an +invisible line and then from $\alpha$ to $\beta$ a helix. +\Lcs{rput} has to be used if they are to be placed at a +particular position. The advantage is that with \Lcs{psCoil} the number of +helixes to draw can be specified exactly. + +\medskip\noindent +\begin{LTXexample}[width=4cm] +\begin{pspicture}(4,4) +\psCoil[linewidth=1.5pt,coilwidth=.5cm]{1800}{3600} +\rput{-90}(3,4){\psCoil[linecolor=red,coilheight=0.25]{0}{3600}} +\rput{-45}(0,3.5){\psCoil[doubleline=true,linecolor=cyan,coilheight=0.75]{100}{2700}} +\end{pspicture} +\end{LTXexample} + + + +% --------------------------------------------------------------------------------------- +\subsection{\nxLcs{pszigzag}}\label{subsec:pstcoil:zigzag} +% --------------------------------------------------------------------------------------- +This macro represents the two dimensional variant and is +correspondly easy to use. Especially the \Lkeyword{linearc} option can bring good +results for \Lcs{pszigzag}. The specification of the ``arm length''{} is not +absolute here, since the line is principally ended in the geometrical middle and +then led to the specified arm length. + +\medskip\noindent +\begin{LTXexample}[width=4cm] +\begin{pspicture}(4,4) +\pszigzag[coilarm=.5cm,linewidth=1.5pt,coilwidth=.5cm]{|->}(4,3) +\pszigzag[linecolor=red,coilheight=0.2](3,4)(3,1) +\pszigzag[doubleline,linecolor=cyan,coilheight=0.75](0,4)(3,0) +\end{pspicture} +\end{LTXexample} + + +\medskip\noindent +\begin{LTXexample}[width=4cm] +\begin{pspicture}(4,4) +\pszigzag[coilarm=.5cm, + linewidth=1.5pt,bow=5mm, + coilwidth=.5cm]{|->}(4,3) +\pszigzag[linecolor=red,bow=-1cm, + coilheight=0.2](3,4)(3,1) +\pszigzag[doubleline, + linecolor=cyan,bow=1cm, + coilheight=0.75](0,4)(3,0) +\end{pspicture} +\end{LTXexample} + +% --------------------------------------------------------------------------------------- +\section{Node connections}\label{sec:pstcoil:knotenverbindungen} +% --------------------------------------------------------------------------------------- +Prerequisite for this macro is that \LPack{pst-node} +is loaded, then the following node connections are available: + +\bigskip +\begin{BDef} +\LcsStar{nccoil}\OptArgs\OptArg*{\Largb{arrows}}\Largb{nodeA}\Largb{nodeB}\\ +\LcsStar{nczigzag}\OptArgs\OptArg*{\Largb{arrows}}\Largb{nodeA}\Largb{nodeB}\\ +\LcsStar{pccoil}\OptArgs\OptArg*{\Largb{arrows}}\Largb{nodeA}\Largb{nodeB}\\ +\LcsStar{pczigzag}\OptArgs\OptArg*{\Largb{arrows}}\Largb{nodeA}\Largb{nodeB}\\ +\LcsStar{ncsin}\OptArgs\OptArg*{\Largb{arrows}}\Largb{nodeA}\Largb{nodeB}\\ +\LcsStar{pcsin}\OptArgs\OptArg*{\Largb{arrows}}\Largb{nodeA}\Largb{nodeB} +\end{BDef} + +\medskip\noindent +\begin{LTXexample}[width=4cm] +\begin{pspicture}(4,3) +\pnode(0.5,0.5){A} +\pnode(3.5,2.5){B} +\ncsin{<->}{A}{B} +\end{pspicture} +\end{LTXexample} + + +\medskip\noindent +\begin{LTXexample}[width=5cm] +\begin{pspicture}(5,2) +\pnode(0,1){A} +\pnode(5,1){B} +\ncsin[amplitude=0.5,periods=30,coilarm=5pt, + function=dup 0.1 mul sin exch sin add]{A}{B} +\end{pspicture} +\end{LTXexample} + + +Th other connections behave completely analogue to those dealt with the +package \LPack{pst-node} so that +no further explanations are needed here. + +\clearpage + +\section{List of all optional arguments for \texttt{pst-coil}} + +\xkvview{family=pst-coil,columns={key,type,default}} + +\nocite{*} +\bgroup +\RaggedRight +\bibliographystyle{plain} +\bibliography{pst-coil-doc} +\egroup + +\printindex + + +\end{document} diff --git a/graphics/pstricks/contrib/pst-coil/dvips/pst-coil.pro b/graphics/pstricks/contrib/pst-coil/dvips/pst-coil.pro new file mode 100644 index 0000000000..9513e99194 --- /dev/null +++ b/graphics/pstricks/contrib/pst-coil/dvips/pst-coil.pro @@ -0,0 +1,131 @@ +%!ps +% PostScript prologue for pst-coil.tex. +% Version 1.07, 2015/05/13 +% For distribution, see pstricks.tex. +% +/tx@CoilDict 40 dict def tx@CoilDict begin +/CoilLoop { + /t ED + t sin AspectSin mul t 180 div AspectCos mul add t cos lineto } def +/Coil { + /Inc ED + dup sin /AspectSin ED + cos /AspectCos ED + /ArmB ED + /ArmA ED + /h ED /w ED /y1 ED /x1 ED /y0 ED /x0 ED + x0 y0 translate y1 y0 sub x1 x0 sub 2 copy Pyth + /TotalLength ED + Atan rotate + /BeginAngle ArmA AspectCos Div w h mul Div 360 mul def + /EndAngle TotalLength ArmB sub AspectCos Div + w h mul Div 360 mul def + 1 0 0 0 ArrowA ArmA 0 lineto + /mtrx CM def + w h mul 2 Div w 2 Div scale BeginAngle Inc + EndAngle { CoilLoop } for + EndAngle CoilLoop mtrx setmatrix TotalLength ArmB sub 0 lineto CP +% DG/SR modification begin - Jun. 2, 1998 - Patch 1 (from Michael Vulis) +% TotalLength 0 ArrowB lineto } def + TotalLength 0 ArrowB lineto + pop pop pop pop } def +% DG/SR modification end +% +/Sin { + 25 dict begin + /Func ED + /PointsPerPeriod ED + /ArmB ED + /ArmA ED + /Amplitude ED + /roundValue ED + /relativePeriod ED + /Periods ED + /y1 ED /x1 ED /y0 ED /x0 ED + y1 y0 sub x1 x0 sub 2 copy Pyth + dup /TotalLength ED + ArmA sub ArmB sub /SinLength ED + Atan /RotAngle ED + relativePeriod + {} + { SinLength Periods div + roundValue dup 0 eq { pop cvi } { 1 eq { round } if } ifelse + /Periods ED } ifelse + /dxStep SinLength 360 div def % the default step for x pos + /xStep 360 PointsPerPeriod div def % the step for the for loop + /mtrx CM def + x0 y0 translate + RotAngle rotate + 1 0 0 0 ArrowA ArmA 0 lineto + 1 xStep 360 { % PointsPerPeriod times + dup dxStep mul ArmA add exch % x pos and value for the func + Periods mul Func Amplitude mul lineto + } for + TotalLength ArmB sub 0 lineto CP + TotalLength 0 ArrowB lineto + mtrx setmatrix + pop pop pop pop + end +} def +% +/AltCoil { + /Inc ED + dup sin /AspectSin ED + cos /AspectCos ED /h ED /w ED /EndAngle ED /BeginAngle ED + /mtrx CM def + w h mul 2 Div w 2 Div scale BeginAngle sin AspectSin mul + BeginAngle 180 div AspectCos mul add BeginAngle cos + /lineto load stopped { moveto } if + BeginAngle Inc EndAngle { CoilLoop } for + EndAngle CoilLoop mtrx setmatrix } def +/ZigZag { 15 dict begin + /ArmB ED /ArmA ED + 2 div /w ED + w mul /h ED /y1 ED /x1 ED /y0 ED /x0 ED + x1 y1 translate y0 y1 sub x0 x1 sub 2 copy Pyth + /TotalLength ED + Atan rotate TotalLength ArmA sub ArmB sub dup h div cvi /n ED n h mul + sub 2 div dup ArmA add + /ArmA ED ArmB add + /ArmB ED + /x ArmB h 2 div add def + mark 0 0 ArmB 0 + n { x w /w w neg def /x x h add def } repeat + TotalLength ArmA sub 0 TotalLength 0 + end } def +% + /ZigZagCirc { % x0 y0 x1 y1 bow h w ArmA ArmB on stack + /bow ED + /ArmB ED /ArmA ED + 2 div /w ED + w mul /h ED /y1 ED /x1 ED /y0 ED /x0 ED + x1 y1 translate % + y0 y1 sub x0 x1 sub 2 copy Pyth 2 div + /HalfLength ED + Atan /ang ED %angle of A relative to B + %rotate % so end B is origin and BA is horizontal, A to right + /theta bow abs HalfLength Atan 2 mul def %halfangular sector for arc + /theta2 theta 2 mul def % full arc + %/psi ang 90 sub theta sub def % angle of B from center if bow>0 + /rho HalfLength theta sin div def % radius of circle + bow 0 gt { /direc 1 def /thetaB ang 90 sub theta sub def } % travel B to A in pos drn + { /direc -1 def /thetaB ang 90 add theta add def } ifelse % travel B to A in neg drn + %thetaB=angle from center to B + rho thetaB 180 add PtoC translate % origin now at center + /h h rho div RadtoDeg def + /ArmA ArmA rho div RadtoDeg def /ArmB ArmB rho div RadtoDeg def + theta2 ArmA sub ArmB sub dup h div cvi /n ED n h mul + %HalfLength 2 mul ArmA sub ArmB sub dup h div cvi /n ED n h mul + sub 2 div dup ArmA add + /ArmA ED ArmB add /ArmB ED + /h h direc mul def % h is now angle increment for half-period + /rhoo rho w add def /rhoi rho w sub def % outer and inner radii + /arg thetaB ArmB direc mul add def % argument for 2nd point +% thetaB = direc = bow = HalfLength = theta = rho = arg = h = n = + mark rho thetaB PtoC rho arg PtoC /arg arg h 2 div add def + n { w 0 gt { rhoo }{ rhoi } ifelse arg PtoC /w w neg def /arg arg h add def } repeat + rho thetaB theta2 ArmA sub direc mul add PtoC rho thetaB theta2 direc mul add PtoC + } def +% +end +% END pst-coil.pro diff --git a/graphics/pstricks/contrib/pst-coil/latex/pst-coil.sty b/graphics/pstricks/contrib/pst-coil/latex/pst-coil.sty new file mode 100644 index 0000000000..d5b0311532 --- /dev/null +++ b/graphics/pstricks/contrib/pst-coil/latex/pst-coil.sty @@ -0,0 +1,13 @@ +%% $Id: pst-coil.sty 539 2011-07-12 08:22:33Z herbert $ +\RequirePackage{pstricks} +\ProvidesPackage{pst-coil}[2010/02/01 package wrapper for + pst-coil.tex (hv)] +\input{pst-coil.tex} +\IfFileExists{pst-coil.pro}{% + \ProvidesFile{pst-coil.pro} + [2011/07/12 v. 1.05, PostScript prologue file (hv)] + \@addtofilelist{pst-coil.pro}}{}% +\ProvidesFile{pst-coil.tex} + [\filedate\space v\fileversion\space `PST-coil' (tvz,hv)] +\endinput + diff --git a/graphics/pstricks/contrib/pst-coil/tex/pst-coil.tex b/graphics/pstricks/contrib/pst-coil/tex/pst-coil.tex new file mode 100644 index 0000000000..cd15fa0537 --- /dev/null +++ b/graphics/pstricks/contrib/pst-coil/tex/pst-coil.tex @@ -0,0 +1,227 @@ +%% $Id: pst-coil.tex 578 2011-09-18 17:18:46Z herbert $ +%% BEGIN pst-coil.tex +%% +%% Coils and zigzags with PSTricks +%% See the PSTricks User's Guide for documentation. +%% For use with the PostScript header file `pst-coil.pro'. +%% +%% +%% COPYRIGHT 1993, 1994, 1999 by Timothy Van Zandt, tvz@nwu.edu. +%% 2006-2015 Herbert Voss, hvoss@tug.org +%% +%% 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. +%% +\message{ v\fileversion, \filedate} +\csname PSTcoilsLoaded\endcsname +\let\PSTcoilsLoaded\endinput +% +\ifx\PSTricksLoaded\endinput \else\input pstricks.tex\fi +\ifx\PSTnodeLoaded\endinput \else\input pst-node.tex\fi +\ifx\PSTXKeyLoaded\endinput \else\input pst-xkey \fi +% +\def\fileversion{1.07} +\def\filedate{2015/05/13} +% +\edef\TheAtCode{\the\catcode`\@} +\catcode`\@=11 +% +\pst@addfams{pst-coil} +\pstheader{pst-coil.pro} +\edef\pst@theheaders{\pst@theheaders,pst-coil.pro} +\def\pst@CoilDict{tx@CoilDict begin } +% +\def\tx@CoilLoop {\pst@CoilDict CoilLoop end } +\def\tx@Coil {\pst@CoilDict Coil end } +\def\tx@AltCoil {\pst@CoilDict AltCoil end } +\def\tx@ZigZag {\pst@CoilDict ZigZag end } +\def\tx@ZigZagCirc{\pst@CoilDict ZigZagCirc end } +\def\tx@Sin {\pst@CoilDict Sin end } +% +\define@key[psset]{pst-coil}{coilwidth}[1cm]{\pst@getlength{#1}\psk@coilwidth} +\define@key[psset]{pst-coil}{coilheight}[1]{\pst@checknum{#1}\pscoilheight} +\define@key[psset]{pst-coil}{coilarmA}[0.5cm]{\pst@getlength{#1}\psk@coilarmA} +\define@key[psset]{pst-coil}{coilarmB}[0.5cm]{\pst@getlength{#1}\psk@coilarmB} +\define@key[psset]{pst-coil}{coilarm}[0.5cm]{% + \pst@getlength{#1}\psk@coilarmA% + \let\psk@coilarmB\psk@coilarmA} +\define@key[psset]{pst-coil}{coilaspect}[45]{\pst@getangle{#1}\psk@coilaspect} +\define@key[psset]{pst-coil}{coilinc}[10]{\pst@getangle{#1}\psk@coilinc} +% +\psset[pst-coil]{coilaspect=45,coilarm=.5cm,coilheight=1,coilwidth=1cm,coilinc=10} +% +\def\pscoil{\def\pst@par{}\pst@object{pscoil}} +\def\pscoil@i{\pst@getarrows\pscoil@ii} +\def\pscoil@ii(#1){\@ifnextchar({\pscoil@iii{1}(#1)}{\pscoil@iii{\z@}(0,0)(#1)}} +\def\pscoil@iii#1(#2)(#3){% + \begin@OpenObj + \pst@getcoor{#2}\pst@tempa + \pst@getcoor{#3}\pst@tempb + \pst@optcp{#1}\pst@tempa + \addto@pscode{% + \pst@tempa \pst@tempb + \psk@coilwidth \pscoilheight + \psk@coilarmA \psk@coilarmB + \psk@coilaspect \psk@coilinc + \tx@Coil }% + \showpointsfalse + \end@OpenObj} +% +\def\psCoil{\def\pst@par{}\pst@object{psCoil}} +\def\psCoil@i#1#2{% + \begin@AltOpenObj + \showpointsfalse + \pst@getangle{#1}\pst@tempa + \pst@getangle{#2}\pst@tempb + \addto@pscode{% + \pst@tempa + \pst@tempb + \psk@coilwidth + \pscoilheight + \psk@coilaspect + \psk@coilinc + \tx@AltCoil + \@nameuse{psls@\pslinestyle} }% + \end@OpenObj} +% +\define@key[psset]{pst-coil}{bow}[0]{% + \pst@getlength{#1}\psk@bow% + \pst@dimm=\psk@bow pt% + \pst@absdim{\pst@dimm}{\pst@dimn}% + \ifdim\pst@dimn<1pt \def\psk@bow{0}\fi}% +\psset[pst-coil]{bow=0} +% +\def\pszigzag{\def\pst@par{}\pst@object{pszigzag}} +\def\pszigzag@i{\pst@getarrows\pszigzag@ii} +\def\pszigzag@ii(#1){\@ifnextchar({\pszigzag@iii{1}(#1)}{\pszigzag@iii{\z@}(0,0)(#1)}} +\def\pszigzag@iii#1(#2)(#3){% + \addbefore@par{bow=0}% + \begin@OpenObj% + \pst@getcoor{#2}\pst@tempA% + \pst@getcoor{#3}\pst@tempB% + \pst@optcp{#1}\pst@tempA% + \addto@pscode{% + \pst@tempA + \pst@tempB + \pscoilheight + \psk@coilwidth + \psk@coilarmA + \psk@coilarmB + \ifdim\psk@bow pt=\z@ \tx@ZigZag \else \psk@bow\space \tx@ZigZagCirc \fi + \psline@iii + \tx@Line }% + \end@OpenObj} +% +\def\nccoil{\pst@object{nccoil}} +\def\nccoil@i{\check@arrow{\nccoil@ii}} +\def\nccoil@ii#1#2{\nc@object{Open}{#1}{#2}{.5}{% + \tx@NCCoor + tx@Dict begin +% DG/SR modification begin - Mar. 19, 1998 - Patch 2 + 4 2 roll +% DG/SR modification end + \psk@coilwidth \pscoilheight + \psk@coilarmA \psk@coilarmB + \psk@coilaspect \psk@coilinc + \tx@Coil + end }} +% +\def\pccoil{\def\pst@par{}\pst@object{pccoil}} +\def\pccoil@i{\pc@object\nccoil@ii} +% +\def\nczigzag{\pst@object{nczigzag}} +\def\nczigzag@i{\check@arrow{\nczigzag@ii}} +\def\nczigzag@ii#1#2{\nc@object{Open}{#1}{#2}{.5}{% + \tx@NCCoor + tx@Dict begin +% DG/SR modification begin - Mar. 19, 1998 - Patch 2 + 4 2 roll +% DG/SR modification end + \pscoilheight + \psk@coilwidth + \psk@coilarmA + \psk@coilarmB + \ifdim\psk@bow pt=\z@\tx@ZigZag\else\psk@bow\space\tx@ZigZagCirc\fi + \psline@iii + \tx@Line + end }} +% +\def\pczigzag{\def\pst@par{}\pst@object{pczigzag}} +\def\pczigzag@i{\pc@object\nczigzag@ii} +% +\def\pst@checkUnit#1#2{\expandafter\pst@checkUnit@i#1!!#2} +% 3.5 relative value \def\pst@roundValue{-1} +% 3.5mm absolute value {-1} +% *3.5mm absolute value, with real->int conversion (truncate) {0} +% **3.5mm absolute value, with real->int conversion (round) {1} +\def\pst@checkUnit@i{\@ifnextchar*% + {\def\pst@roundValue{0 }\pst@checkUnit@ii}% + {\def\pst@roundValue{-1 }\pst@checkUnit@iii**}} +\def\pst@checkUnit@ii*{\@ifnextchar*% + {\def\pst@roundValue{1 }\pst@checkUnit@iii*}% + {\pst@checkUnit@iii**}} +\def\pst@checkUnit@iii**#1!!#2{% + \edef\ps@next{#1}% + \ifx\ps@next\@empty\let\pst@num\z@% + \else\expandafter\pst@@checknum\ps@next..\@nil% + \fi% + \ifnum\pst@num=\z@\pst@getlength{#1}{#2}\def\pst@relativePeriod{false }% + \else% + \def\pst@relativePeriod{true }% + \edef#2{\ifnum\pst@num=\tw@-\fi\the\pst@cntg.% + \expandafter\@gobble\the\pst@cnth\space}% + \fi} +% +\define@key[psset]{pst-coil}{periods}[1]{\pst@checkUnit{#1}{\psk@periods}} +\define@key[psset]{pst-coil}{amplitude}[1]{\def\psk@amplitude{#1 }} +\define@key[psset]{pst-coil}{ppoints}[360]{\def\psk@ppoints{#1 }} +\define@key[psset]{pst-coil}{function}[sin]{\def\psk@function{#1 }} +\psset[pst-coil]{periods=1,amplitude=1,ppoints=360,function=sin} +% +\def\pssin{\pst@object{pssin}} +\def\pssin@i{\pst@getarrows\pssin@ii} +\def\pssin@ii(#1){\@ifnextchar({\pssin@iii{1}(#1)}{\pssin@iii{\z@}(0,0)(#1)}} +\def\pssin@iii#1(#2)(#3){% + \begin@OpenObj + \pst@getcoor{#2}\pst@tempa + \pst@getcoor{#3}\pst@tempb + \pst@optcp{#1}\pst@tempa + \addto@pscode{% + \pst@tempa \pst@tempb + \psk@periods + \pst@relativePeriod + \pst@roundValue + \psk@amplitude \pst@number\psyunit mul + \psk@coilarmA \psk@coilarmB + \psk@ppoints + { \psk@function } + \tx@Sin + }% + \showpointsfalse% + \end@OpenObj} +% +\def\ncsin{\pst@object{ncsin}} +\def\ncsin@i{\check@arrow{\ncsin@ii}} +\def\ncsin@ii#1#2{\nc@object{Open}{#1}{#2}{.5}{% + \tx@NCCoor + tx@Dict begin + 4 2 roll + \psk@periods + \pst@relativePeriod + \pst@roundValue + \psk@amplitude \pst@number\psyunit mul + \psk@coilarmA \psk@coilarmB + \psk@ppoints + { \psk@function } + \tx@Sin + end }} +% +\def\pcsin{\def\pst@par{}\pst@object{pcsin}} +\def\pcsin@i{\pc@object\ncsin@ii} +% +% +\catcode`\@=\TheAtCode\relax +\endinput +%% +%% END pst-coil.tex |