Solve Matrix Determinant

I’m trying to implement a point inclusion within tetrahedron check. I know the vertices of the tetrahedron (as well as the faces) and the point I want to check. The point to check is not a Unity GameObject, but the tetrahedron vertices can be.

Ideally I would like to get this Point in Tetrahedron Test working, hence the need for the determinant. I don’t see a way to do this with the Matrix4x4 class unless I’m missing something. Does anyone have any advice for a lib to use of some sort or just do it the long way?

1 Answer

1

I was able to get this working using the Matrix class from here as it has a “Determinant” method, although, it gives exceptions when zero instead of just returning 0 as a 0 determinant in this case would simply mean the point you are checking for inclusion is on the same plane (boundary) as one of your tetrahedron planes.
http://blog.ivank.net/lightweight-matrix-class-in-c-strassen-algorithm-lu-decomposition.html