How to use this tetrahedron volume equation?

Started by
5 comments, last by Zakwayda 18 years, 11 months ago
Hi im calculating the volume of a tetrahedron(triangular pyramid), and I've got this equation which looks like its using matrices, as I dont know a whole lot about matrices, I was wondering if someone could help explain to me or show me, how to use this equation to get the volume?

          |x1–x4   y1–y4   z1–z4|
 V = (1/6)|x2–x4   y2–y4   z2–z4|
          |x3–x4   y3–y4   z3–z4|

Thanks
Advertisement
That's a determinant, scroll down for a 3x3. That should get you started on finding out what the equation says.
In case you haven't written a matrix library yet, you can also google for 'triple product'.
btw, pyramids and tetrahedrons are different shapes. A pyramid has 4 triangular faces with 1 quadrilateral face, while a tetrahedron only has 4 triangular faces.
Actualy a pyramid has n triangular faces and 1 n-sided polygonal face.

So tetrahedrons are a subset of the larger class of pyramids. (A tetrahedron is a pyramid with an equilateral triangle as a "base face" [spelling?] and 3 equilateral triangles, of the same surface as the "base face", as "side faces" [spelling?].)
Wait so what your saying is, all 4 triangles have to be of the same size for that equation to work properly?

As I ran that equation in my program and also tried the 1/6 * edge * height1 * height2 equation on paper and I got the same answer... which was what i wanted. And the base triangle wasnt an equallateral triangle, either were the side triangles.

Thanks
Quote:Wait so what your saying is, all 4 triangles have to be of the same size for that equation to work properly?

As I ran that equation in my program and also tried the 1/6 * edge * height1 * height2 equation on paper and I got the same answer... which was what i wanted. And the base triangle wasnt an equallateral triangle, either were the side triangles.
As you noted, the equation you posted works for general tetrahedra; the sides need not be equilateral. Furthermore, the equation returns the signed volume. The absolute value is the volume, and the sign tells you something about how the points are arranged relative to each other. The equation can be used, for example, as a relative line orientation predicate, useful in ray-triangle intersection. Note that if you are only interested in the sign, you can drop the 1/6.

This topic is closed to new replies.

Advertisement