# arrows in the middle of bezier curves

Paulo Abreu paulotex at geocities.com
Sun Dec 7 10:49:09 CET 1997

```-----------------------------------------------------------------------------
This is the PSTricks mailing list, devoted to discussions about computational
graphics in (La)TeX using the PSTricks package from Timothy van Zandt.
For help using this mailing list, see instructions at the end of message.
-----------------------------------------------------------------------------

Hi, all!

This is my first message to this list.

I consider PsTricks a wonderfull package for (La)TeX.

I am typesetting a book about differential equations,
with lots of curves and arrows, and graphs and
shadded regions, and pstricks is a great help. Just
creating each graphic with CorelDraw or
Mathematica wasn't enough for the high quality
output needed. Pstricks is the package for the job.

There is, however, a small feature that I miss a lot:
the ability to put an arrow automaticaly in the middle
of a curve.

I am able to create that arrow when I
can draw the curve parametricaly: I simply draw part of
the curve with the arrow I need, and then another
part, and so on, until the curve is complete. Some times
I need to go back a little to draw over the tip of
the last arrow, but that's not really a problem.
E.g., here's how I draw a circle with radius R
with two arrows in it:
\psset{arrows=->}
\parametricplot{0}{182}{%
R t cos mul R t sin mul}
\parametricplot{180}{362}{%
R t cos mul R t sin mul}

(note: (R*cos(t), R*sin(t)) with  0 < t <= 360 is a circle)

The thing is more complicated when I want to have
arrows somewhere in the middle of a bezier curve.
The only solution I found for that is to print the curve,
measure on the paper where I want to put the arrows and
where will they point to, and then draw a \psline with
[linestyle=none] and with {->} or whatever arrow, so that
the arrow falls in the curve and points the right direction.
This methode is cumbersome, slow and needs lots of adjustments.

Has anyone got a better suggestion?

I have also tried to split the bezier curve in the point
where I want the arrow to appear, but this involves two
problems:
1. more calculations to fit two curves to the path of one
(anyone has an algorithm to find the points of two
bezier curves that fit into the path of a third one,
given the points of the third curve?)
2. even when the two curves fit, it is usually necessary
to overlap them a bit, so that the tip of the arrow
is inside of a curve.

I am also aware of the \arrows{...} command, but I think
that it isn't the solution (or I am missing something there?)

I hope I wasn't to unclear stating the problem. It is
always hard to describe a graphic, and the task is even
harder when it is not in your language.

Thanks to everybody that helped making PsTricks the
good and powerful package I enjoy so much!

Paulo

-----------------------------------------------------------------------------