Search found 2 matches

by maneco2
Sat Mar 23, 2024 6:01 pm
Forum: Libraries and Tools
Topic: Fast 2D point-in-polygon test
Replies: 13
Views: 20451

Re: Fast 2D point-in-polygon test

-- By Pedro Gimeno, donated to the public domain function isPointInPolygon(x, y, poly) local x1, y1, x2, y2 local len = #poly x2, y2 = poly[len - 1], poly[len] local wn = 0 for idx = 1, len, 2 do x1, y1 = x2, y2 x2, y2 = poly[idx], poly[idx + 1] if y1 > y then if (y2 <= y) and (x1 - x) * (y2 - y) <...
by maneco2
Sun Feb 19, 2023 12:36 am
Forum: Support and Development
Topic: Target range coordenate
Replies: 1
Views: 601

Target range coordenate

have any wayt to get coordenate of distance of the target selected? function FollowDistance(target,dist) YQ = target:GetLocation().Y YP = self:GetLocation().Y XQ = target:GetLocation().X XP = self:GetLocation().X Mp = -1/((YQ-YP)/(XQ-XP)) if ((-2*XP-2*Mp*Mp*XP)*(-2*XP-2*Mp*Mp*XP) -4*(Mp*Mp+1)*(Mp*Mp...