[pstricks] psarc

Poul Riis Poul.Riis at skolekom.dk
Sat Nov 22 18:12:50 CET 2008


Thank you - but the arrow heads seem to be somewhat displaced - try
example below.

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,-2.5)(80,20)
\psaxes[Dx=5,Dy=5,ticksize=-3pt]{->}(0,0)(80,20)
\pstVerb{
	/gg 9.82 def
	/v0 20 def
	/w0y 10 neg def
	/theta 60 def
	/v0x v0 theta cos mul def
	/v0z v0 theta sin mul def
	/wang 1 v0x div 60 mul def
	/alpha 0.6 def
	/eps 0.9 def
	/epsz 0.8 def
	/beta eps 1 add alpha 1 add div def
	/alphabeta alpha beta mul def
	/enminusalphabeta 1 alphabeta sub def
	/enminusbeta 1 beta sub def
	/x0 0 def
	/z0 0 def
	/xT v0z v0x mul gg div x0 add def
	/zT v0z dup mul 2 div gg div z0 add def
	/pi 3.141592 def
}%
\SpecialCoor
\uput{2mm}[0](!50
20){$\epsilon=$\psPrintValue[valuewidth=6,fontscale=8]{eps}}
\uput{2mm}[0](!50
18){$\epsilon_z=$\psPrintValue[valuewidth=6,fontscale=8]{epsz}}
\uput{2mm}[0](!50 16){$v_0_x=$\psPrintValue[valuewidth=6,fontscale=8]{v0x}}
\uput{2mm}[0](!50 14){$w_0_y=$\psPrintValue[valuewidth=6,fontscale=8]{w0y}}
\multido{\nn=0+1}{6}{%\uput{2mm}[0](!10 2 2 \nn\space mul add
){$xT=$\psPrintValue[valuewidth=12,fontscale=8]{xT}}%
\parabola[linecolor=Blue1](!x0 z0)(!xT x0 add zT)%
\parabola[arrowscale=2,arrows=->,linecolor=Blue1,linewidth=0.25pt](!x0 xT
2 div add zT 3 mul 4 div)(!xT x0 add zT)%
\pscircle*[linecolor=red](!xT x0 add zT){0.5}
\pscustom[linecolor=black,linewidth=0.4pt,arrowscale=2]{%
  \arrows{<->}
  \code{ xT x0 add 5.69 mul /x ED zT 5.60 mul /y ED 1.5 5.69 mul /r ED
         w0y 0 gt
           { x r sub dup y exch 1 add y 1 add 4 2 roll ArrowA pop pop
stroke}
           { x r add dup y exch 1 sub y 1 add 4 2 roll ArrowB pop pop
pop pop stroke}
         ifelse
         x y r 90 w0y abs wang mul sub 90 w0y abs wang mul add arc }
}
%\psarc[linecolor=Red1,linewidth=0.4pt]{->}(!xT x0 add zT){1.5}{!90 w0y
abs wang mul sub}{!90 w0y abs wang mul add}
\pstVerb{v0z epsz mul /v0z exch def
 v0x enminusalphabeta mul w0y alphabeta mul add /v1x exch def
 w0y enminusbeta mul v0x beta mul add /w0y exch def
 v1x /v0x exch def
 xT 2 mul x0 add /x0 exch def
 v0z v0x mul gg div /xT exch def
 v0z dup mul 2 div gg div z0 add /zT exch def }%
}
\end{pspicture}
\end{center}
\end{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
t sin x2 mul c0w div  zz}%
}%
\end{pspicture}
\end{center}



\end{document}




More information about the PSTricks mailing list