On 23 April 2010 00:02, Bo Jacoby <[email protected]> wrote: > The winding number program (%&0j2p1)@(+/)@:^.@(% _1&|.) is not "slow, > unstable, and incomplete (hence buggy)".
Of course it is. It does not handle boundary cases. It uses too complicated operations, introducing inaccuracy and unstability where it – by the nature of the problem – should absolutely not. That same operations make it slow, too. You have been pointed out by others in this thread that your formula fails to treat boundary cases. And when corrected, it is not at all that short (while still unnecessarily relying on floating-point arithmetic, therefore retaining its suboptimal accuracy). You have also been pointed out to literature where the known methods are compared, and the WN method is found to be the worst known by all measures. Yet you continue telling us how good it is. > … the standard complex number arithmetic, which is provided by J and well > tested. Tested it is, no doubt, but that is not what is under discussion. We are discussing the qualities of two computational methods. > The regular pentagon _1^+:(%~i.)5 has irrational vertex coordinates, so > integer coordinates do restrict the arbitrariness of polygon forms. They don't. Apart from the fact that a regular polygon is hardly arbitrary, what you fail to observe is that a good computational method preserves the domain it works in. The intersection counting method (including the particular case of a convex polygon), when given integer data, works with integers throughout, and when given floating-point coordinates, works just as well with them. The WN method is insensitive to its data, doing always f.p. computations, and thus introducing inaccuracy even when that can be avoided. The fact is, even when doing f.p. arithmetic on f.p. coordinates, the intersection counting method is preferable as being more stable and accurate. ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
