[pstricks] Exiting a parametricplot

Herbert Voss Herbert.Voss at FU-Berlin.DE
Sat Nov 22 20:47:29 CET 2008


Poul Riis schrieb:
> How can I exit a parametricplot. The example below works only if I remove
> zz 0 lt {exit} if
> from the \parametricplot command.

you have to be inside the loop. The reason why you have to
put the exit if in \parametric at ii and use plotstyle=line

Herbert

\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}
\makeatletter
\def\parametricplot at ii{%
    \addto at pscode{%
      /psExit false def
      xy \@nameuse{beginqp@\psplotstyle}
      \psk at plotpoints 1 sub {
        /t t dt add def
        xy \@nameuse{doqp@\psplotstyle}
        psExit pstack { exit } if
      } repeat
      psExit not {
        /t t1 def
        xy \@nameuse{doqp@\psplotstyle}
      } if }%
  \@nameuse{endqp@\psplotstyle}}
\makeatother

\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=line]{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 { /psExit true def } if
  t sin x2 mul c0w div zz}%
}%
\end{pspicture}
\end{center}
\end{document}




More information about the PSTricks mailing list