Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2011.01.02;
Скачать: CL | DM;

Вниз

Находится ли точка в полигоне 2D?   Найти похожие ветки 

 
Moroz4   (2008-04-22 15:16) [0]

как узнать находится ли точка в полигоне 2D?


 
DVM ©   (2008-04-22 15:27) [1]

PtInRegion + CreatePolygonRgn


 
MBo ©   (2008-04-22 15:38) [2]

http://local.wasp.uwa.edu.au/~pbourke/geometry/insidepoly/
http://tog.acm.org/editors/erich/ptinpoly/
http://en.wikipedia.org/wiki/Point_in_polygon


 
DVM ©   (2008-04-22 15:42) [3]

function PtInPolygon(const Points: TPoints; P: TPoint): Boolean;
var
 Cnt, I, J: Integer;
begin
 Result := False;
 Cnt := Length(Points);
 J := Cnt - 1;
 for I := 0 to Cnt - 1 do
 begin
   if ((Points[I].y <= P.y) and (P.y < Points[J].y)) or
     ((Points[J].y <= P.y) and (P.y < Points[I].y)) then
   begin
     if (P.x < (Points[J].x - Points[I].x) * (P.y - Points[I].y) /
       (Points[J].y - Points[I].y) + Points[I].x) then
       Result := not Result;
   end;
   J := I;
 end;
end;



Страницы: 1 вся ветка

Текущий архив: 2011.01.02;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.005 c
2-1286348534
Иван
2010-10-06 11:02
2011.01.02
запись в Record из memo


2-1282054512
Black123
2010-08-17 18:15
2011.01.02
TWebBrowser и WEB2.0


6-1231408626
DSKalugin
2009-01-08 12:57
2011.01.02
Soap, HTTPRIO и SSL (Ошибочная авторизация сертификата)


15-1285100963
Юрий
2010-09-22 00:29
2011.01.02
С днем рождения ! 22 сентября 2010 среда


15-1285071657
неокубинец
2010-09-21 16:20
2011.01.02
нашёл Зенит 11