[pstricks] psclip

Martin Chicoine martin.chicoine at umontreal.ca
Tue Nov 11 15:21:45 CET 2008


> 
> What is wrong with psclip in the example below?
> 
> Poul Riis
> 
> 
> 
> \documentclass[a4paper,12pt]{article}
> \usepackage{inputenc}
> \usepackage[T1]{fontenc}
> \usepackage[danish]{babel}
> \usepackage[usenames,dvipsnames,x11names]{xcolor}
> \usepackage{ifthen}
> \usepackage{geometry}
> \usepackage{multido}
> \usepackage{pst-func}
> \usepackage{pstricks-add}
> 
> 
> \def\getColor#1{\ifcase#1 black\or red\or magenta\or yellow\or green\or
> Orange\or blue\or
> 3 DarkOrchid\or BrickRed\or Rhodamine\or OliveGreen\fi}
> 
> 
> \begin{document}
> \begin{center}
> \psset{unit=2mm}
> \begin{pspicture}(-25,-5)(40,25)
> \psaxes[Dx=5,Dy=5,ticksize=-3pt]{->}(0,0)(-25,0)(40,25)
> \multido{\nn=0+1}{10}{%
> \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 /theta thetac \nn\space 2 sub 5 mul sub
> def
> /x1 theta sin v0 mul def /x2 gg c0w div def /x3 theta cos v0 mul x2 add
> def /pi 3.141592 def}%
> \psclip{\psframe[linecolor=red](-25,0)(40,25)}%
> \parametricplot[linecolor=\getColor{\nn}]{0}{45}{t cos neg 1 add x1 mul
> t
> sin x3 mul add c0w div  t 180 div pi mul c0w div x2 mul sub t cos neg 1
> add x3 mul neg t sin x1 mul add c0w div}%
> \endpsclip
> }
> \uput{2mm}[0](10,20){$\theta_c=$\psPrintValue[valuewidth=8,fontscale=8]
> {thetac}}
> \end{pspicture}
> \end{center}
> \end{document}
> 

It works if you remove the "3" in the definition of getColor and the percent
signs at the end of the lines.

Martin.



More information about the PSTricks mailing list