I want to compute the area of a random polygon and the volume of a random polyhedron. Google searches led me to tessellation and the Monte Carlo method. However I am only interested in an exact calculation and not an approximation through convergence. Might someone know the exact formulae by heart or have a link to a page where such formulae are described?
The formulae are not needed to apply to exotic polygons or polyhedrons. I am already satisfied if they apply to simple (non-intersecting edges) convex shapes. I would like to use nothing else besides a list of vertex coordinates [(x1, y1), ..., (xn, yn)]
or [(x1, y1, z1), ..., (xn, yn, zn)]
, possible arranged in a specific order.
I am able to read Fortran
, C/C++
, Python
and MATLAB
. Hence an algorithm written in any of these languages or written in pseudo-code is well received.