[metapost] Re: new is_clockwise routine

Laurence Finston lfinsto1 at gwdg.de
Sun Nov 27 13:32:29 CET 2005

On Sun, 27 Nov 2005, Werner LEMBERG wrote:

> I thought that the idea of my code is quite obvious, but apparently it
> isn't.  Here's the used algorithm.

I don't usually find reading other people's code enjoyable.  Thank you for
the explanation in plain English.

>   1. Find a point P on the path which has a non-zero direction.


> This method completely avoids any problems with the geometry of Bézier
> curves.

It seems like a roundabout way of doing it, which is the impression I had
before.  You asked for comments, so I explained how I plan to go about
it, if and when I reach this point.  If it's not helpful to you, please
disregard it.  I don't see any problems with the geometry of Bezier
curves.  One can convert the representation using control points into a
polynomial and manipulate the latter using straightforward and
well-documented methods.

> > A more serious problem is determining whether the curve loops or
> > changes direction between two values of 't'.
> As mentioned in my last mail, I assume that the curve doesn't
> intersect itself.  It's not needed for my particular problem, and it
> makes life much simpler.

I try to find general solutions without losing touch with reality.


More information about the metapost mailing list