[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



	/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
\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
\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}
  \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
           { x r add dup y exch 1 sub y 1 add 4 2 roll ArrowB pop pop
pop pop stroke}
         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 }%

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


More information about the PSTricks mailing list