  | |  | Point Inside a triangle | Point Inside a triangle 2003-12-14 - By Alexx
Back
Hi
I got a function to test if point lies in or out a polygon :
on isInside(pt,pt1,pt2,pt3) x=pt[1] y=pt[2] x1=pt1[1] y1=pt1[2] x2=pt2[1] y2=pt2[2] x3=pt3[1] y3=pt3[2]
fAB = (y-y1)*(x2-x1) - (x-x1)*(y2-y1) fCA = (y-y3)*(x1-x3) - (x-x3)*(y1-y3) fBC = (y-y2)*(x3-x2) - (x-x2)*(y3-y2)
if (fAB*fBC>0 and fBC*fCA>0) then return true else return false end if end
my problem is that I want a function to return true when the point lies exactly on the edge of the polygon.. for now it return false :(
could someone help me please ?
bye
Alexx
__ ____ ____ ____ ____ ____ ____ ____ ____ ____ dirGames-L mailing list - dirGames-L@(protected) http://nuttybar.drama.uga.edu/mailman/listinfo/dirgames-l
Earn $52 per hosting referral at Lunarpages.
|
|
 |