[pstricks] psclip

Herbert Voss Herbert.Voss at FU-Berlin.DE
Tue Nov 11 18:57:09 CET 2008


Poul Riis schrieb:
> What is wrong with psclip in the example below?

a Problem with pstVerb

Herbert

\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 DarkOrchid\or BrickRed\or Rhodamine\or OliveGreen\fi}

\begin{document}
\begin{center}
\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
  /x2 gg c0w div def
  /thetac sinthetac costhetac atan def }
\psset{unit=2mm}
\begin{pspicture}(-25,-5)(40,25)
\psaxes[Dx=5,Dy=5,ticksize=-3pt]{->}(0,0)(-25,0)(40,25)
\begin{psclip}{\psframe[linecolor=red](-25,0)(40,25)}%
\multido{\nn=0+1}{10}{%
\parametricplot[plotpoints=1000,unit=5,linecolor=\getColor{\nn}]{0}{45}{%
  /theta thetac \nn\space 2 sub 5 mul sub def
  /x1 theta sin v0 mul def
  /x3 theta cos v0 mul x2 add def
  t cos neg 1 add x1 mul t sin x3 mul add
  c0w div t DegtoRad c0w div x2 mul sub
  t cos neg 1 add x3 mul neg t sin x1 mul add c0w div}
}
\end{psclip}
\uput{2mm}[0](10,20){$\theta_c=$\psPrintValue[valuewidth=8,fontscale=8]{thetac}}
\end{pspicture}

\end{center}
\end{document}




More information about the PSTricks mailing list