# Volume of multi-dimensional polygon

**URL:** <https://boards.straightdope.com/t/volume-of-multi-dimensional-polygon/505971>\
**Category:** Factual Questions\
**Created:** [August 10, 2009, 8:15pm UTC](https://boards.straightdope.com/t/volume-of-multi-dimensional-polygon/505971 "2009-08-10T20:15:54Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dervorin](https://avatars.discourse-cdn.com/v4/letter/d/eb8c5e/32.png) [@Dervorin](https://boards.straightdope.com/u/Dervorin)\
**Post date:** [August 10, 2009, 8:15pm UTC](https://boards.straightdope.com/t/volume-of-multi-dimensional-polygon/505971/1 "2009-08-10T20:15:54Z")

</div>

This isn’t homework, before anyone asks; it’s a discussion we’ve been wrestling with for a while now, so I turn to the combined wisdom of the Dope to assist us in trying to solve it.

I have a cloud of points in n-dimensional space, and want to find the volume of the convex polyhedron that these points define. In 2D space, I have found a systematic and simple way of doing it, but we’re not clear how that would generalise to N dimensions. Is there a standard way of a) determining the points that are the vertices and b) calculating the volume of this polyhedron? I don’t need an exact value; a numerical approximation would do, provided it was reasonably accurate. Any suggestions or places I can look that would help in solving this seemingly intractable problem?

Could a passing mod change the title from “polygon” to “polyhedron”? Thanks.

---

<div class="post-metadata">

**Author:** ![Cabbage](https://avatars.discourse-cdn.com/v4/letter/c/f07891/32.png) [@Cabbage](https://boards.straightdope.com/u/Cabbage)\
**Post date:** [August 10, 2009, 9:08pm UTC](https://boards.straightdope.com/t/volume-of-multi-dimensional-polygon/505971/2 "2009-08-10T21:08:25Z")

</div>

This is not something I’m familiar with, but I am aware of Pick’s Theorem, so I checked to see if there is a higher dimensional analogue of that. I found [this](http://en.wikipedia.org/wiki/Ehrhart_polynomial), which looks like a good starting point, at least.

---

<div class="post-metadata">

**Author:** ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)\
**Post date:** [August 10, 2009, 9:17pm UTC](https://boards.straightdope.com/t/volume-of-multi-dimensional-polygon/505971/3 "2009-08-10T21:17:29Z")

</div>

Even finding which points are the vertices is probably going to be tricky. If I had to do this, I think I’d do a Monte Carlo approximation: Find some simple larger volume that completely encompasses your cloud (probably a hypercube or hyper-rectangular prism), pick a point at random within that volume, then figure out a way to determine if that point is inside or outside the convex hull of the polygon. Repeat a few thousand times, and the proportion of points that fall inside the hull is the ratio of the volume of the hull to the volume of the containing box.

---

<div class="post-metadata">

**Author:** ![Crescend](https://avatars.discourse-cdn.com/v4/letter/c/b9bd4f/32.png) [@Crescend](https://boards.straightdope.com/u/Crescend)\
**Post date:** [August 10, 2009, 9:22pm UTC](https://boards.straightdope.com/t/volume-of-multi-dimensional-polygon/505971/4 "2009-08-10T21:22:32Z")

</div>

Isn’t this basically computing the volume of an n-dimensional convex hull? There are algorithms for that, like [quickhull](http://www.qhull.org/).

---

<div class="post-metadata">

**Author:** ![ultrafilter](https://avatars.discourse-cdn.com/v4/letter/u/3d9bf3/32.png) [@ultrafilter](https://boards.straightdope.com/u/ultrafilter)\
**Post date:** [August 11, 2009, 4:50am UTC](https://boards.straightdope.com/t/volume-of-multi-dimensional-polygon/505971/5 "2009-08-11T04:50:59Z")

</div>

> [@Crescend](#):
>
> Isn’t this basically computing the volume of an n-dimensional convex hull? There are algorithms for that, like [quickhull](http://www.qhull.org/).

This is what you want. A Monte Carlo algorithm would be great if there were a simple way to compute whether a point is in the convex hull without going through the trouble of computing it, but I don’t know of any good way to do so in general.

---

<div class="post-metadata">

**Author:** ![Dervorin](https://avatars.discourse-cdn.com/v4/letter/d/eb8c5e/32.png) [@Dervorin](https://boards.straightdope.com/u/Dervorin)\
**Post date:** [August 11, 2009, 12:54pm UTC](https://boards.straightdope.com/t/volume-of-multi-dimensional-polygon/505971/6 "2009-08-11T12:54:20Z")

</div>

Thanks for your help, all. Part of the problem was not knowing the terminology - I’d never heard the term “convex hull” before researching this, so we didn’t know where to start looking.

I’m looking into qhull; it seems as though it’s capable of doing what I need. I’m just a little concerned that it may be computationally too complex, as we have 125 points in 26 dimensions. But I’m going to gradually build up to that and see where it goes. Cheers again!
