[pstricks] psarc
Poul Riis
Poul.Riis at skolekom.dk
Sat Nov 22 13:04:24 CET 2008
Still one problem remains in my figure below: How can I reverse the
direction of the arrow in case w0y is positive?
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}
\psarc[linecolor=black,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}
More information about the PSTricks
mailing list