[metapost] Re: new is_clockwise routine

Giuseppe Bilotta gip.bilotta at iol.it
Wed Nov 30 10:59:03 CET 2005

Wednesday, November 30, 2005 Dan Luecking wrote:

> Giuseppe: What you called a knot is what I would call a loop.
> But what is the "knot factor"?  If that just the discriminant
> of g'xg''?

I obtain it as the only possibly-negative factor of the
discriminant of the second-degree equation that gives the
time value for the cusp or the time values where the loop
crosses itself (the other factor is a sqaure, so it's always
non-negative). Apart from a constant numerical factor, it's
equal to

4 (P1 - P0) × (P2 - P1) (P2 - P1) × (P3 - P2) -
  ((P1 - P0) × (P3 - P2))^2

If a curve has a cusp, it's null. If the curve has a
knot/loop it's positive. However, it can be null or positive
even if the curve does *not* have a loop or cusp.

Giuseppe "Oblomov" Bilotta

More information about the metapost mailing list