[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


\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 }%

	/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
/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}%

More information about the PSTricks mailing list