[pstricks] Curved arrowheads

Poul Riis Poul.Riis at skolekom.dk
Thu Jun 10 16:16:52 CEST 2010


I think someone on the list requested arcs with curved arrowheads.
Here is one suggestion - which probably could be greatly improved....



Poul Riis





\documentclass[12pt,a4paper]{article}
\usepackage{inputenc}
\usepackage[T1]{fontenc}
\usepackage{geometry}
\usepackage{graphicx}
\usepackage{pstricks-add}

\pagestyle{plain}

\begin{document}
\begin{center}
\psset{unit=2mm}
\begin{pspicture}(-20,-15)(40,20)
\psaxes[Dx=5,Dy=5,ticksize=-3pt]{->}(0,0)(-20,-15)(40,20)
\pstVerb{
	/pi 3.141592 def
/newarcarrow { %def
gsave
/lw exch def /endang exch def /startang exch def 5.69 mul /rr exch def
5.69 mul /cy exch def 5.69 mul /cx exch def lw setlinewidth 5 lw mul
/ahsize exch def endang startang sub abs pi mul 180 div rr 1 add mul
/smallahsize exch def 5 smallahsize gt {smallahsize /ahsize exch def} if
startang endang lt {/psi rr 1 add ahsize exch div 57 mul neg def cx cy rr
startang endang psi add arc stroke} {/psi rr 1 add ahsize exch div 57 mul
def cx cy rr endang psi add startang arc stroke} ifelse endang cos rr mul
cx add endang sin rr mul cy add moveto 10 10 360 {/ii exch def 3 ii cos 2
mul sub ii 2 mul cos sub 2 mul 9 div /xf exch def ii sin 2 mul ii 2 mul
sin sub 9 div /yf exch def endang psi xf mul add /actang exch def rr
ahsize yf mul add /actrr exch def actang cos actrr mul cx add actang sin
actrr mul cy add lineto} for closepath fill stroke
grestore
newpath
} bind def
}%

\pscustom{%
\code{1 0 0 setrgbcolor 0 0 5 0 120 5 newarcarrow 0 1 0 setrgbcolor 0 0 5
120 240 5 newarcarrow 0 0 1 setrgbcolor 10 10 5 0 360 5
newarcarrow}%(xstart, ystart, radius, startang, endang, linewidth)
}
\psset{linecolor=magenta}
\psarc[linewidth=5pt,arrows=->](!0 0){7}{0}{120}
\psarc[linewidth=5pt,arrows=->](!0 0){7}{120}{240}
\psarc[linewidth=5pt,arrows=->](!25 10){5}{0}{360}
\end{pspicture}
\end{center}

\end{document}

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/pstricks/attachments/20100610/df8ecafb/attachment.html>


More information about the PSTricks mailing list