The winding number program (%&0j2p1)@(+/)@:^.@(% _1&|.) is not "slow, unstable, and incomplete (hence buggy)". It is easier and safer to debug small programs than bigger ones. The complexity of the winding number program lies in the standard complex number arithmetic, which is provided by J and well tested.
The regular pentagon _1^+:(%~i.)5 has irrational vertex coordinates, so integer coordinates do restrict the arbitrariness of polygon forms. -Bo --- Den tors 22/4/10 skrev Boyko Bantchev <[email protected]>: Fra: Boyko Bantchev <[email protected]> Emne: Re: [Jprogramming] Polygon containment Til: "Programming forum" <[email protected]> Dato: torsdag 22. april 2010 20.38 On 22 April 2010 15:53, Bo Jacoby <[email protected]> wrote: > It is fair to assume that Dan Bron, when asking the J Programming Forum "to > check whether a point falls within an arbitrary polygon", wants a short > J-program rather than optimized assembler code. I doubt if anyone would want a slow, unstable, and incomplete (hence buggy) program only because it is short. > The vertices of an "arbitrary polygon" does not have integer coordinates. Arbitrariness is related to the polygon's form, not to the domain of its coordinates. It is perfectly possible to speak of arbitrary polygons (or whatever figures) in a discrete coordinate system, e.g. raster. ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm __________________________________________________ Bruger du Yahoo!? Er du træt af spam? Yahoo!Mail har den bedste spambeskyttelse, der findes http://dk.mail.yahoo.com ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
