Algoritmo Acumulación 20200411

1. ZC: Encuentre si cierto punto está dentro del cuadrilátero ( convexo )

 Determine si un punto está dentro de un cuadrilátero_Inteligencia Artificial_san_Junipero's blog-CSDN blog.html ( https://blog.csdn.net/San_Junipero/article/details/79172260 )

 Conocidos cuatro puntos cuadrilátero, buscando una solución en el punto está dentro del cuadrilátero de la inteligencia artificial _ _laukaka columna -CSDN el blog .html ( https://blog.csdn.net/laukaka/article/details/45168439 )

     isPointInRect privado booleano ( int x, int y) 
{
Punto final A = mLBPoint; Punto final B = mLTPoint; Punto final C = mRTPoint; Punto final D = mRBPoint; final int a = (Bx - Ax) * (y - Ay) - (Por - Ay) * (x - Ax); final int b = (Cx - Bx) * (y - By) - (Cy - By) * (x - Bx); int final c = (Dx - Cx) * (y - Cy) - (Dy - Cy) * (x - Cx); int final d = (Ax - Dx) * (y - Dy) - (Ay - Dy) * (x - Dx); if ((a> 0 && b> 0 && c> 0 && d> 0) || (a <0 && b <0 && c <0 && d <0 )) { return true ; } // AB X AP = (bx - ax, by - ay) x (px - ax, py - ay) = (bx - ax) * (py - ay) - (by - ay) * (px - ax) ; // BC X BP = (cx - bx, cy - by) x (px - bx, py - by) = (cx - bx) * (py - by) - (cy - by) * (px - bx); devuelve falso ;
}

 

2 、

3 、

4 、

5 、

 

Supongo que te gusta

Origin www.cnblogs.com/csskill/p/12677644.html
Recomendado
Clasificación