end
-- Returns true if the point p lies inside the polygon[] with n vertices
-function isInside(listPoints,p)
+function isInside(listPoints,p,h)
+ -- if the point is to close to a point of the polygon
+ for i=1,#listPoints do
+ if(math.sqrt(math.pow(p.x-listPoints[i].x,2) + math.pow(p.y-listPoints[i].y,2))<0.4*h) then
+ return false
+ end
+ end
-- There must be at least 3 vertices in polygon[]
if (#listPoints <= 3) then return false end
-- Create a point for line segment from p to infinite