PSTricks – How to Draw Arrows Along a Path

pstricks

Inspired by this question, I've tried to find a command for drawing arrows along a path with PSTricks.

\documentclass{article}

\usepackage{pst-plot}

\begin{document}

\psset{unit = 2}
\begin{pspicture}(-1.2,-1.2)(1.5,1.5)
  \psaxes{->}(0,0)(-1.2,-1.2)(1.3,1.3)[$x$,0][$y$,90]
  \parametricplot[
    linecolor = red,
    linewidth = 1.2pt,
    plotstyle = ccurve
  ]{0}{180}{
    3 t mul cos t cos mul
    3 t mul cos t sin mul
  }
\end{pspicture}

\end{document}

output

Is it possible to draw arrows along anything but lines (see page 96–97 in the pstricks-add manual)? In case it is, how do I do that?

Update

Herbert has given an alternative PSTricks solution here.

Best Answer

You can do that with the \pscurvepoints command, which creates an array of points on the curve, and \pspolylineticks (§ 30 of pstricks-add documentation: *Ticks and other marks along a curve, pp. 107–117). What I don't understand quite well are the parameters, so I played with them. Here is an example:

\documentclass[pdf, x11names]{standalone}

\usepackage{pstricks-add}

\begin{document}

\psset{unit = 5}
\begin{pspicture}(-1.2,-1.2)(1.5,1.5)
  \psaxes{->}(0,0)(-1.2,-1.2)(1.3,1.3)[$x$,0][$y$,90]
  \parametricplot[
    linecolor = red,
    linewidth = 1.2pt,
    plotstyle = ccurve,
    plotpoints=100
  ]{0}{180}{
    3 t mul cos t cos mul
    3 t mul cos t sin mul
  }
\pscurvepoints[plotpoints=100]{0}{180}{
    3 t mul cos t cos mul
    3 t mul cos t sin mul
  }{P}
%
\pspolylineticks[Os=0,Ds=1,ticksize=0 0]{P}%
{ ds }{0}{360}% distance
\multido{\i=0+1}{100}{\psrline[linecolor = red,linewidth = 1.2pt, arrows=->,arrowscale=2](PTick\i)(2pt;{(
PTangent\i)})}%
\end{pspicture}

\end{document}

And the resulting curve:

enter image description here

Related Question