[metapost] turningnumber revisited

Boguslaw Jackowski B_Jackowski at GUST.org.pl
Tue Jun 28 20:52:38 CEST 2011

Thank you Dan for your explanations. One doubt:

> Exactly such a situation would render the winding of of Q about
> a point problematic. So in this sense a puzzling case has already
> surfaced. If one cannot determine reliably determine intersection
> of paths, one cannot reliably determine whether a point is on a
> path and therefore whether a winding number exists.

Still, I believe that estimating the distance of a point from a path
is les "whimsical" operation than, say, computing the number of square 
roots of a quadratic. In the algorithm (stemmed from Lary's ideas)
computing the winding number the distance can be safely estimated.
I cannot see a puzzling case other than for points very close
to a path: after a simple transformation the winding number may 
suddenly turn out to be undefined, because the "pivot" point
has migrated by epsilon; but this I'd consider a safe behavior.

Perhaps the built-in windingnumber function could have a global
parameter determining the minimal distance (adequately to the
engine precision), and in the case of emergency (unlike the turningnumber
function) could return undefined result.

Cheers -- Jacko

  Bogus\l{}aw Jackowski: B_Jackowski at GUST.ORG.PL
  Hofstadter's Law: It always takes longer than you expect, even
                    when you take into account Hofstadter's Law.

More information about the metapost mailing list