Re: Point in Poly formula



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

BigAl.NZ@xxxxxxxxx wrote:
> Right, so they are a set of x,y co-ords that define one edge of the
> polygon?
>
> And is "C = !C" equate to C = NOT C? I dont quite get what the C is
> doing? Its defined initally at 0 and the for loop runs through, but
> that does not seem to affect the value of C???

yes it means c= NOT c and in fact it effects the c value in the loop.
The c=!c line does alternate the c with 1 and 0 every time this line is
executed. The idea is, that if you cross an even number of edges from the given
point you're point is outside and if its odd its inside. You could also use
something like c++; and instead of return c you use return c%2.

Regards
Stefan

>
> Cheers
>
> -Al
>

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1rc2 (MingW32)

iD8DBQFDz2BRyeCLzp/JKjARAtg7AJ9jWchPfaFbErCkxWJj+uvlgbl0dQCdGdb4
RERy1mxg2/K09TqhieOYW1k=
=3DZQ
-----END PGP SIGNATURE-----
.



Relevant Pages

  • Re: Point in Poly formula
    ... Right, so they are a set of x,y co-ords that define one edge of the ... Its defined initally at 0 and the for loop runs through, ... Prev by Date: ...
    (comp.graphics.algorithms)
  • Re: Arrange points so polygon is not self intersecting
    ... self-intersecting. ... Connect all the points in some order to get a polygon, ... these choices makes two loops, the other keeps it as one loop. ... This algorithm will terminate because the total edge length decreases ...
    (sci.math)
  • Re: Arrange points so polygon is not self intersecting
    ... self-intersecting. ... Connect all the points in some order to get a polygon, ... these choices makes two loops, the other keeps it as one loop. ... This algorithm will terminate because the total edge length decreases ...
    (sci.math)
  • Re: GDI+ Z-order?
    ... same, a.k.a, I don't want to outline the polygon, as I would have used ... So I need to build my pts array in order to be able to draw my polygon, ... but while I loop for that, I thought 'why not draw the lines'...Now, I ... Dim pts(5) As Point ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: GDI+ Z-order?
    ... but while I loop for that, I thought 'why not draw the lines'...Now, I ... end up with my polygon drawn after, because I can only draw it once I ... Dim linesAs Point ...
    (microsoft.public.dotnet.languages.csharp)