Tuesday, October 21, 2014

easy way to find the volume of a polyhedron

An easy formula for finding the volume of a polyhedron when you know the coordinates of the vertices...

where the bars are absolute value.

The sums in this formula are over all of the faces, Maxheight is the maximum height for any of the vertices, MinHeight the minimum value of the height of all vertices. F(i)Aveheight is the average of the height coordinates of the ith face and F(i)Area is the area of a face polygon after all the height coordinates are replaced with 0.

To see why it works first think of the 2 dimensional version of this formula:

We start finding the area B underneath each face down to the minimum value the height coordinate takes on. The red area would only be counted once as it is below the faces along the top and above any of the faces along the bottom, but we count the area underneath the faces along the bottom as well so the purple area ends up being counted twice. The area of each face is calculated as the average value of the height of the face, times the length when the height coordinates are replaced by 0 for the two vertices in the 2d case this is just the width.  

Now we do almost the same thing but find the area T above the faces of the polygons up to the maximum value of the height coordinate (Note that this area will be negative). 
Now we can solve that the total area of the polygon will be abs(T-B)/2 because it is the symmetric difference of the two overlapping regions.  It's hard to do a direct proof because of the absolute values but one way to reason about it is if you have a cube so that T and B are each the whole volume of the cube, but B negative, then it would be abs(T-B)/2, but that always has to be the solution because it is always the same system of linear equations relating T,B, the red area and the total area. 

So this same sort of thing is presented above for 3 dimensions, but it is average values of faces times the area of face polygons when the heights are replaced by 0 to make shafts of volume, but otherwise the same concept.  


No comments:

Post a Comment