Point in Tetrahedron

207 Views Asked by At

I found this page this page that describes a method to verify if a given point P = (x, y, z) is inside a tetrahedron specified by its vertices Vi. I implemented the method and tested it on the example:

V1 = (0.0 0.0 0.0);
V2 = (1.0 0.0 0.0);
V3 = (1.0 1.0 0.0);
V4 = (0.5 0.5 1.0);

P = (0.2 0.2 0.2);

So in my opinion, P should clearly be in the tetrahedron defined by V1-V4. For the test, the matrices D0-D4 are:

d0:                   d1:                   d2:                    d3:                    d4: 
0.0 0.0 0.0 1.0       0.2 0.2 0.2 1.0       0.0 0.0 0.0 1.0        0.0 0.0 0.0 1.0        0.0 0.0 0.0 1.0
1.0 0.0 0.0 1.0       1.0 0.0 0.0 1.0       0.2 0.2 0.2 1.0        1.0 0.0 0.0 1.0        1.0 0.0 0.0 1.0
1.0 1.0 0.0 1.0       1.0 1.0 0.0 1.0       1.0 1.0 0.0 1.0        0.2 0.2 0.2 1.0        1.0 1.0 0.0 1.0
0.5 0.5 1.0 1.0       0.5 0.5 1.0 1.0       0.5 0.5 1.0 1.0        0.5 0.5 1.0 1.0        0.2 0.2 0.2 1.0

For the determinants I get

d0Det: -1.0
d1Det: -0.7
d2Det: 0.0
d3Det: -0.1
d4Det: -0.2

Whatever I do, I always get d2Det = 0.0 and thus my implementation tells me, that P is on the boundary of the tetrahedron.

Am I missing something here, or does the method simply not work for general cases?

1

There are 1 best solutions below

1
On BEST ANSWER

$P$ is not inside the tetrahedron; it's on the boundary.

Explicitly, $$P={\small{\frac{7}{10}}}V_1+{\small{\frac{1}{10}}}V_3+{\small{\frac{1}{5}}}V_4$$ which is a strict convex combination of $V_1,V_3,V_4$.