[pstricks] more confusion

Michael Sharpe msharpe at ucsd.edu
Sun Jan 1 20:05:23 CET 2012


On Jan 1, 2012, at 10:07 AM, Nitecki, Zbigniew H. wrote:

> Inside a pspicture environment, the code
> 
> \parametricplot[linecolor=red]{-1.6}{1.6}{t COSH 2 mul t SINH 1.5 2 mul mul}
> 
> (correctly) gives me the right branch of the hyperbola (x^2)/4-(y^2)/9=1, in red.
> 
> But the code
> 
> \newcommand{\frbranch}[5][1.0]{%
> \parametricplot[linecolor=#4]{-#5}{#5}{%
> {t COSH #2 mul t SINH #1 #3 mul mul}
> }
> }%Colored right branch of hyperbola x^{2}/A^{2}-y^{2}/B^{2}=C^{2};  arguments are:
> %#1=B/A =slope of asymptotes:  default is 1.0
> %#2=AC=distance of vertex from origin
> %#3=A
> %#4=color
> %#5=range:  to fit inside axb box, use
> %#5=MIN(cosh^{-1}(a/A), sinh^{-1}(b/B))
> \begin{pspicture}(-5,-5)(5,5)
> \frbranch[1.5]{2}{2}{red}{1.6}
> \end{pspicture}
> 
> crashes on execution.
> 
> What am I doing wrong? (Ignore my choice of #5=1.6.  It was an arbitrary choice which should affect nothing.)

You have an additional pair of braces around the function, which prevents PostScript from executing the code. You should instead write

> \newcommand{\frbranch}[5][1.0]{%
> \parametricplot[linecolor=#4]{-#5}{#5}%
> {t COSH #2 mul t SINH #1 #3 mul mul}
> }

Michael




More information about the PSTricks mailing list