Lower dimensional volumes
Posted: 13 Jun 2014, 12:29
I have been asked how to compute lower dimensional volumes in polymake. There is no direct method yet; so here is an example indicating a workaround:
Let's take a polytope in a hyperplane.
We compute its (d-1)-dimensional volume (here: length of an edge) by computing the d-dimensional volume of a pyramid (here: area of a triangle).
We need to know/compute the distance of the point to the hyperplane. Here it is natural that a square root shows up.
Now reverting the volume formula for a pyramid yields the desired answer:
A seemingly simpler way would be to take a prism rather than a pyramid. While this might simplify some formula, it is computationally much more expensive. The reason is that volume computation uses triangulations. The triangulations of a pyramid are in correspondence with the triangulations of its base, while for prisms the triangulations always get more messy.
Let's take a polytope in a hyperplane.
Code: Select all
polytope > $poly_in_hyperplane=new Polytope(POINTS=>[[1,1,0],[1,0,1]]);
Code: Select all
polytope > $point_outside_hyperplane=new Vector([1,0,0]);
polytope > $pyramid=new Polytope(POINTS=>$poly_in_hyperplane->VERTICES/$point_outside_hyperplane);
Code: Select all
polytope > $height=1/2 * (new QuadraticExtension(0,1,2)); # 1/2 sqrt(2)
Code: Select all
polytope > print 2 * $pyramid->VOLUME / $height;
0+1r2