I gave the coordinates of 1000 triangles on the plane (triangle number (T0001-T1000) and its coordinates (x1, y1) (x2, y2), (x3, y3)). Now, for a given point P (x, y), I need to find a triangle that contains a point P.
One option might be to check all the triangles and find a triangle containing P. But I'm looking for an effective solution to this problem.
source
share