Check if a given point is inside the convex hull of 4 points.

441 Views Asked by At

Given 4 points (A,B,C,D) in a 2D plane, how do i check if a point M is inside the convex hull of those points? Can i take the four triangles ABC, ABD, ACD, BCD and check if M is inside one of them? Or do i have to compute the convex hull using Jarvis march? Is there a simpler solution?

1

There are 1 best solutions below

6
On BEST ANSWER

The convex hull can be constructed as only 2 triangles.

You could also try to evaluate the bilinear coordinates of M with respect of it and verify if they range in [0,1]²