2

I'm not a mathematician. I'm wondering if there is a general formula that allows you to calculate the volume of any polyhedron (regular or not) starting from the coordinates of the vertices of the polyhedron.

In crystallography the position of the atoms is described by fractional coordinates of the basis vectors (the basis vectors can be Cartesian or not, depending on the type of structure). I was therefore wondering if starting from the coordinates of these atoms (those at the vertices of the polyhedron and the atom at the center of the polyhedron itself), it could be possible to calculate the volume.

Perhaps it would be possible to simplify the problem by calculating the total volume as the sum of the volumes subtended by each face of the polyhedron, then considering each time only the coordinates of the central atom and those of the atoms forming one of the faces of the polyhedron. Even in this case, however, I do not know what formula to apply.

gryphys
  • 121

1 Answers1

1

You need to know more than just the vertices. For each face of the polyhedron, you need to which vertices form the corners of the face and in which order they occur. And the direction of that ordering should be consistent between faces. The usual way to organize them is by the right-hand rule (the left-hand rule would work about as well, but the right-hand rule is the common choice). That is, if you point the thumb of your right-hand in the direction perpendicular to the face and pointing outside the polyhedron, then the order in which the vertices are listed should be in the direction that the fingers of your right hand curl.

With this information, finding the volume is a straight-forward calculation, and one commonly performed. Many analyses of object designs in industry are obtained by approximating the shape of the object with a "triangulation" of the surface: a polyhedron with many small triangular faces approximating the surface of the object. Calculating the volume of that polyhedron is the simplest of the many calculations this is used for.

The trick of it is easily described, though it takes a bit of work to accomplish:

  1. Convert all the faces to triangles. If you have any non-triangular faces, choose a vertex, and add diagonals to each of the other non-neighboring vertices of the face, breaking the face into triangles. The vertices for each of the triangles should once again to ordered by the right-hand-rule.
  2. Each triangle forms a tetrahedron with the origin. Calculate the signed volumes of these tetrahedra. The volume should be positive if the origin is on the same side of the triangular face as the polyhedron, and negative if the origin is on the opposite side of that face. This sounds complex, but if you've ordered the vertices by the right-hand rule, it is actually easy. If $v_1, v_2, v_3$ are the three vertices of the face in order, then the signed volume of the tetrahedron is $$V_T = \frac16v_1 \cdot (v_2 \times v_3)$$
  3. Sum the signed volumes of the tetrahedra for each of the faces. The sum will be the volume of the polyhedron.

This works no matter what the shape of the polyhedron or the location of the origin. The positive-volumes occur where the tetrahedron is on the same side of the face as the polyhedron, so it includes volume inside the polyhedron. That tetrahedron may extend outside the polyhedron, but when it does, it passes through other faces, and the tetrahedra for those faces will have negative volume and thus subtract off the portions of the positive tetrahedron that lie outside.

Paul Sinclair
  • 45,932
  • thanks for your answer, but actually I was looking for a formula that starting from the Cartesian coordinates of 4 or more points in space would provide the inscribed volume. I was wondering if it was possible using matrices – gryphys Apr 07 '25 at 07:26
  • @gryphys - And I am looking for a billionaire to magnanimously donate a large fortune to me. But alas, both ot us need to adjust our expectations to cruel reality. There is not some neat formula that is going to give you the volume of any polyhedron, or even any convex polyhedron (which seems likely to be all you need). Instead the best you can hope for is a convenient algorithm for calculating it. And that is what I have provided. If matrices are more appealing to you than vector operations, $v_1 \cdot (v_2 \times v_3)$ is also the determinant of the matrix having these vectors as columns. – Paul Sinclair Apr 07 '25 at 13:58
  • I get the irony, but that doesn't mean I don't have a problem to solve and, not being a mathematician, I'd like to know if there is a simple way to do it. Let's look at a practical example: the center of the polyhedron is at the coordinates (1.33,2.66,2.74); we have 4 vertices at (2.6,3.40,4.20), (0,1.33,4.20), (2.66,1.33,1.28) and (0,3.40,1.28). How to do it step by step? – gryphys Apr 08 '25 at 07:31
  • Start by recalling the very first thing I said in the post: Just knowing the vertices is not enough. You have to define the faces. With 4 vertices, this is simple enough. They could only be the vertices of a tetrahedron. Turn one of them into the origin by subtracting it from the other three. These become the $v_1, v_2, v_3$ of the opposite triangular face. Then the volume is $\frac 16 |v_1\cdot v_2 \times v_3|$ where the absolute value removes the need to orient that face (since you do not need to add this tetrahedron to others, we can shortcut). – Paul Sinclair Apr 08 '25 at 11:27