Algoritmus pro ořezávání 2D polygonů
Algoritmus pro ořezávání 2D polygonů
Algoritmus pro ořezávání 2D polygonů
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Winding Number<br />
double isLeft(Point P0, P0, Point P1, Point P2)<br />
{<br />
return((P1.x - P0.x) * (P2.y - P0.y) - (P2.x - P0.x) * (P1.y - P0.y)); P0.y));<br />
}<br />
int WindingNumber(Point WindingNumber(Point P, Point * V, int n)<br />
{<br />
}<br />
int WN WN = 0;<br />
//smyčka přes přes všechny všechny hrany hrany polygonu polygonu<br />
for (int i=0; iP.y)<br />
if(isLeft(V[i],V[i+1],P)>0<br />
++wn; ++wn;<br />
}<br />
else{ // V[i].y> V[i].y> P.y P.y<br />
if(V[i+1].y if(V[i+1].y