[pstricks] Exiting a parametricplot

Michael Sharpe msharpe at ucsd.edu
Sat Nov 22 18:18:53 CET 2008


Paul,

You can achieve what you want with clipping instead of trying to exit.

\psset{unit=2mm}
\begin{pspicture}(-0.5,-0.5)(50,20)
\pstVerb{
	/gg 9.82 def
	/v0 20 def
	/c0w 0.2 def
	/costhetac c0w v0 mul gg div 2 div neg def
	/sinthetac costhetac dup mul neg 1 add sqrt def
	/thetac sinthetac costhetac atan def
	/x2 gg c0w div def
	/pi 3.141592 def
}%
\begin{psclip}{\psframe[linestyle=none](0,0)(50,20)}
\multido{\nn=1+1}{15}{%
\parametricplot
[linecolor=red,plotpoints=200,linewidth=0.5pt,plotstyle=curve]{0}{60}{/ 
theta
\nn\space 5 mul def	/x1 theta sin v0 mul def /x2 theta cos v0 mul def / 
tt
t 180 div pi mul c0w div def /zz tt x1 mul tt dup mul gg mul 2 div sub  
def
  t sin x2 mul c0w div  zz}%
}%
\end{psclip}
\psaxes[Dx=10,Dy=5,ticksize=-3pt]{->}(0,0)(-0.5,-0.5)(50,20)


On Nov 22, 2008, at 8:33 AM, Poul Riis wrote:

> How can I exit a parametricplot. The example below works only if I  
> remove
> zz 0 lt {exit} if
> from the \parametricplot command.
>
> Poul Riis
>
>
>
> \documentclass[a4paper,12pt]{article}
> \usepackage{inputenc}
> \usepackage[T1]{fontenc}
> \usepackage[danish]{babel}
> \usepackage{amsmath}
> \usepackage[usenames,dvipsnames,x11names]{xcolor}
> \usepackage{ifthen}
> \usepackage{geometry}
> \usepackage{multido}
> \usepackage{pst-func}
> \usepackage{pstricks-add}
>
>
> \begin{document}
> \begin{center}
> \psset{unit=2mm}
> \begin{pspicture}(-0.5,-0.5)(50,20)
> \psaxes[Dx=10,Dy=5,ticksize=-3pt]{->}(0,0)(-0.5,-0.5)(50,20)
> \pstVerb{
> 	/gg 9.82 def
> 	/v0 20 def
> 	/c0w 0.2 def
> 	/costhetac c0w v0 mul gg div 2 div neg def
> 	/sinthetac costhetac dup mul neg 1 add sqrt def
> 	/thetac sinthetac costhetac atan def
> 	/x2 gg c0w div def
> 	/pi 3.141592 def
> }%
> \multido{\nn=1+1}{15}{%
> \parametricplot 
> [linecolor=Red1,plotpoints=200,linewidth=0.5pt,plotstyle=curve]{0} 
> {60}{/theta
> \nn\space 5 mul def	/x1 theta sin v0 mul def /x2 theta cos v0 mul  
> def /tt
> t 180 div pi mul c0w div def /zz tt x1 mul tt dup mul gg mul 2 div  
> sub def
> zz 0 lt {exit} if t sin x2 mul c0w div  zz}%
> }%
> \end{pspicture}
> \end{center}
> \end{document}



More information about the PSTricks mailing list