volume

Purpose

Compute the volume of the polyhedron.

Syntax

vol = P.volume
vol = volume(P)

Description

Computes the volume of the polyhedron ../../../../../../fig/mpt/modules/geometry/sets/@Polyhedron/volume1.png using V-representation. If the polyhedron is not in V-representation, it will be converted automatically. Volume is inf if ../../../../../../fig/mpt/modules/geometry/sets/@Polyhedron/volume2.png is unbounded, and zero if ../../../../../../fig/mpt/modules/geometry/sets/@Polyhedron/volume3.png is not full-dimensional.

Input Arguments

P

Polyhedron in any format

Class: Polyhedron

Output Arguments

vol

Volume of P.

Class: double

Example(s)

Example 1

Create polytope and compute volume:
P = ExamplePoly.randHrep('d',5,'n',40); disp(P.volume);
         0.246212279404691

See Also

minvrep


© 2010-2013 Colin Neil Jones: EPF Lausanne, colin.jones@epfl.ch