The statistics presented by R.Boss in this thread seem to be
interpreted by some as a testimony of the relative speed of the two
discussed methods – the ‘intersection number’ (IN) and the ‘winding
number’ (WN).

Such a conclusion would be inappropriate for several reasons that
I am not going to discuss right now, but I cannot but mention the
following: in order to compare programs (because that is what is
being actually compared, not the IN and WN methods), first of all
these programs should be correct.  Lacking correctness, all other
qualities of a program are wholly immaterial!

What do we have?  The supposed ‘winner’, the program W, is so broken
that (as pointed out by R.Boss) for certain valid input not only
returns incorrect results but even produces NaN errors.

wn tries to correct this but also systematically produces incorrect
results.

pinp, on the other hand, I believe to be working correctly.  It does
handle not only simple polygons but also self-intersecting and ones
whose boundaries overlap.  (Moreover, with a trivial modification,
it can work with any number of polygons rather than a single one
(treating nested polygons as holes)).

So, my point is: first get a program correct, then discuss speed or
whatever else.

On 24 April 2010 09:56, Bo Jacoby <[email protected]> wrote:
> .....
> -- "The problem with this scheme is that it involves a square root, 
> arc-cosine, division, dot and cross product for each edge tested"
>
> The author Eric Haines [email protected] does not seem to be familiar with 
> complex analysis, which enables us to use just one division and one logarithm 
> for each edge tested.

I don't know whether E.Haines is familiar with … (most probably he is).
What I do know is that ‘just one division and one logarithm’ is a
self-delusion on your part.  Behind them there is a series of operations
on floating-point (non-complex) values that implement complex
operations.  So E.Heines is right.

> My primary guidelines are beauty and simplicity and generality ...

Even sacrificing correctness?

>... of course I don't mind winning the speed competition

I would not mind too, if you do – but only when you do :)

   B.B.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to