Help on testing point inside a polygon
Posted: Sun May 28, 2006 9:55 am
Hi,
how can i test a point is inside a regular polygon or not?
i was trying to think this way:
#take a random point far away
#make a line with the test point and this random point
#check for intersection between this line and all the edges and count it
#if the count is odd then the point is inside otherwise outside
but i got stuck in the case where my test line will intersect in any of the
vertex of the polygon, now how can i know where the point is?
can anyone help me from here? thanks...
how can i test a point is inside a regular polygon or not?
i was trying to think this way:
#take a random point far away
#make a line with the test point and this random point
#check for intersection between this line and all the edges and count it
#if the count is odd then the point is inside otherwise outside
but i got stuck in the case where my test line will intersect in any of the
vertex of the polygon, now how can i know where the point is?
can anyone help me from here? thanks...