Mega Code Archive

 
Categories / Delphi / Graphic
 

Test if a point is inside a polygon

Title: Test if a point is inside a polygon [delphi]// test if a point is inside a polygon function PointInPoly(APoint : TPoint ; APoly : array of TPoint) : boolean; Var i, j : integer; npol : integer; begin Result := false; npol := length(APoly); for i := 0 to npol - 1 do begin j := (i + 1) mod npol; if ((((APoly.Y