Re: Point in Poly formula
- From: Stefan Rybacki <stefan.rybacki@xxxxxxx>
- Date: Thu, 19 Jan 2006 10:48:02 +0100
-----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-----
.
- Follow-Ups:
- Re: Point in Poly formula
- From: BigAl . NZ
- Re: Point in Poly formula
- References:
- Point in Poly formula
- From: BigAl . NZ
- Re: Point in Poly formula
- From: Just d' FAQs
- Re: Point in Poly formula
- From: BigAl . NZ
- Point in Poly formula
- Prev by Date: Re: Circle segment by Bézier polynomial.
- Next by Date: Re: Point in Poly formula
- Previous by thread: Re: Point in Poly formula
- Next by thread: Re: Point in Poly formula
- Index(es):
Relevant Pages
|