A rational convex Polyhedron is the intersection of finitely many affine half-spaces over QQ or equivalently, the convex hull of a finite set of vertices and rays. A rational convex polyhedral Cone is the intersection of finitely many linear half-spaces over QQ or equivalently, the positive hull of a finite set of rays. A Fan is a finite collection of cones such that for each cone all its faces are in the fan and for two cones in the fan the intersection is a face of each.

`Polyhedra` uses the FourierMotzkin package by Gregory G. Smith. Each polyhedron or cone is saved in both descriptions and a fan is saved as the list of its generating cones.

Here are some examples illustrating the main uses of this package.

For an introduction to polyhedra and cones, we recommend Gunter M. Ziegler's *Lectures on Polytopes*, Graduate Texts in Mathematics 152, Springer-Verlag, New York, 1995.

The author would like to thank Nathan Ilten for contributing several functions to the package.

Version **1.0.5** of this package was accepted for publication in volume 1 of the journal The Journal of Software for Algebra and Geometry: Macaulay2 on 2009-09-07, in the article Polyhedra: a package for computations with convex polyhedral objects. That version can be obtained from the journal or from the *Macaulay2* source code repository, `svn://svn.macaulay2.com/Macaulay2/trunk/M2/Macaulay2/packages/Polyhedra.m2`, release number 9344.

- Types
- Cone -- the class of all rational convex polyhedral cones
- Fan -- the class of all fans
- PolyhedralComplex -- the class of all polyhedral complexes
- PolyhedralObject -- the class of all polyhedral objects in Polyhedra
- Polyhedron -- the class of all convex polyhedra

- Functions and commands
- addCone -- adds cones to a Fan
- addPolyhedron -- adds Polyhedra to a PolyhedralComplex
- affineHull -- computes the affine hull of a polyhedron
- affineImage -- computes the affine image of a cone or polyhedron
- affinePreimage -- computes the affine preimage of a cone or polyhedron
- ambDim -- ambient dimension of a Polyhedron, Cone or Fan
- areCompatible -- checks if the intersection of two cones/polyhedra is a face of each
- bipyramid -- computes the bipyramid over a polyhedron
`boundaryMap`(missing documentation)- ccRefinement -- computes the coarsest common refinement of a set of rays
- cellDecompose -- computes the regular cell decomposition
- commonFace -- checks if the intersection is a face of both Cones or Polyhedra, or of cones with fans
- cones -- computes all cones of a fan of a certain dimension
- coneToPolyhedron -- converts a cone to class Polyhedron
- contains -- checks if the first argument contains the second argument
- convexHull -- computing the convex hull of points, rays and polyhedra
- crossPolytope -- computes the d-dimensional crosspolytope with diameter 2s
- cyclicPolytope -- computes the d dimensional cyclic polytope with n vertices
- directProduct -- computes the direct product of two convex objects
`dualCayley`(missing documentation)`dualCayleyFace`(missing documentation)- dualCone -- computes the dual Cone
- dualFaceLattice -- computes the dual face lattice of a cone or polyhedron
- ehrhart -- calculates the Ehrhart polynomial of a polytope
- emptyPolyhedron -- generates the empty polyhedron in n-space
- faceFan -- computes the fan generated by the cones over the faces
- faceLattice -- computes the face lattice of a cone or polyhedron
`faceOf`(missing documentation)- faces -- computes all faces of a certain codimension of a Cone or Polyhedron
- fan -- generates a Fan
- fVector -- computes the f-vector of a Cone or Polyhedron
- halfspaces -- computes the defining half-spaces of a Cone or a Polyhedron
- hilbertBasis -- computes the Hilbert basis of a Cone
- hirzebruch -- computes the fan of the r-th Hirzebruch surface
- hypercube -- computes the d-dimensional hypercube with edge length 2*s
- hyperplanes -- computes the defining hyperplanes of a Cone or a Polyhedron
- imageFan -- computes the fan of the image
- incompCones -- returns the pairs of incompatible cones
- incompPolyhedra -- returns the pairs of incompatible polyhedra
- inInterior -- checks if a point lies in the relative interior of a Cone/Polyhedron
- interiorLatticePoints -- computes the lattice points in the relative interior of a polytope
- interiorPoint -- computes a point in the relative interior of the Polyhedron
- interiorVector -- computes a vector in the relative interior of a Cone
- intersection -- computes the intersection of half-spaces, hyperplanes, cones, and polyhedra
- isCompact -- checks compactness of a Polyhedron
- isComplete -- checks completeness of a Fan or PolyhedralComplex
- isEmpty -- checks if a Polyhedron is empty
- isFace -- tests if the first argument is a face of the second
- isLatticePolytope -- checks if a polyhedron is a lattice polytope
- isPointed -- checks if a Cone or Fan is pointed
- isPolytopal -- checks if a Fan is polytopal
- isPure -- checks if a Fan or PolyhedralComplex is of pure dimension
- isReflexive -- checks if a Polytope is reflexive
- isSimplicial -- checks if a polyhedral object is simplicial
- isSmooth -- checks if a Cone or Fan is smooth
- isVeryAmple -- checks if the Polyhedron is very ample
- latticePoints -- computes the lattice points of a polytope
- linSpace -- computes a basis of the lineality space
- maxCones -- displays the generating Cones of a Fan
- maxFace -- computes the face of a Polyhedron or Cone where a weight attains its maximum
- maxPolyhedra -- displays the generating Polyhedra of a PolyhedralComplex
- minFace -- computes the face of a Polyhedron or Cone where a weight attains its minimum
- minkowskiSum -- computes the Minkowski sum of two convex objects
- minkSummandCone -- computes the Cone of all Minkowski summands and the minimal decompositions
- mixedVolume -- computes the mixed volume of a list of polytope
- newtonPolytope -- computes the Newton polytope of a polynomial
- normalFan -- computes the normalFan of a polyhedron
- objectiveVector -- computes an objective vector of a face of a polyhedron
- polar -- computes the polar of a polyhedron
- polarFace -- computes the dual face of the polar polyhedron
- polyhedra -- computes all polyhedra of a polyhedral complex of a certain dimension
- polyhedralComplex -- generates a PolyhedralComplex
- polytope -- returns a polytope of which the fan is the normal fan if it is polytopal
- posHull -- computes the positive hull of rays, cones, and the cone over a polyhedron
- posOrthant -- generates the positive orthant in n-space
- proximum -- computes the proximum of the Polyhedron/Cone to a point in euclidian metric
- pyramid -- computes the pyramid over a polyhedron
- rays -- displays all rays of a Cone, a Fan, or a Polyhedron
- saveSession -- save the actual Polyhedra session to a file
- secondaryPolytope -- computes the secondary polytope of a compact polyhedron
- skeleton -- computes the k-skeleton of a Fan or PolyhedralComplex
- smallestFace -- determines the smallest face of the Cone/Polyhedron containing a point
- smoothSubfan -- computes the subfan of all smooth cones
- statePolytope -- computes the state polytope of a homogeneous ideal
- stdSimplex -- generates the d-dimensional standard simplex
- stellarSubdivision -- computes the stellar subdivision of the fan by a ray
- sublatticeBasis -- computes a basis for the sublattice generated by integral vectors or the lattice points of a polytope
- tailCone -- computes the tail/recession cone of a polyhedron
- toSublattice -- calculates the preimage of a polytope in the sublattice generated by its lattice points
- triangulate -- computes a triangulation of a polytope
- vertexEdgeMatrix -- computes the vertex-edge-relations matrix
- vertexFacetMatrix -- computes the vertex-facet-relations matrix
- vertices -- displays the vertices of a Polyhedron or a PolyhedralComplex
- volume -- computes the volume of a polytope

- Methods
- addCone(Cone,Fan), see addCone -- adds cones to a Fan
- addCone(Fan,Fan), see addCone -- adds cones to a Fan
- addCone(List,Fan), see addCone -- adds cones to a Fan
- addPolyhedron(List,PolyhedralComplex), see addPolyhedron -- adds Polyhedra to a PolyhedralComplex
- addPolyhedron(PolyhedralComplex,PolyhedralComplex), see addPolyhedron -- adds Polyhedra to a PolyhedralComplex
- addPolyhedron(Polyhedron,PolyhedralComplex), see addPolyhedron -- adds Polyhedra to a PolyhedralComplex
- affineHull(Polyhedron), see affineHull -- computes the affine hull of a polyhedron
- affineImage(Cone,Matrix), see affineImage(Matrix,Cone,Matrix) -- computes the affine image of a cone
- affineImage(Matrix,Cone), see affineImage(Matrix,Cone,Matrix) -- computes the affine image of a cone
- affineImage(Matrix,Cone,Matrix) -- computes the affine image of a cone
- affineImage(Matrix,Polyhedron), see affineImage(Matrix,Polyhedron,Matrix) -- computes the affine image of a polyhedron
- affineImage(Matrix,Polyhedron,Matrix) -- computes the affine image of a polyhedron
- affineImage(Polyhedron,Matrix), see affineImage(Matrix,Polyhedron,Matrix) -- computes the affine image of a polyhedron
- affinePreimage(Cone,Matrix), see affinePreimage(Matrix,Cone,Matrix) -- computes the affine preimage of a cone
- affinePreimage(Matrix,Cone), see affinePreimage(Matrix,Cone,Matrix) -- computes the affine preimage of a cone
- affinePreimage(Matrix,Cone,Matrix) -- computes the affine preimage of a cone
- affinePreimage(Matrix,Polyhedron), see affinePreimage(Matrix,Polyhedron,Matrix) -- computes the affine preimage of a polyhedron
- affinePreimage(Matrix,Polyhedron,Matrix) -- computes the affine preimage of a polyhedron
- affinePreimage(Polyhedron,Matrix), see affinePreimage(Matrix,Polyhedron,Matrix) -- computes the affine preimage of a polyhedron
- ambDim(PolyhedralObject), see ambDim -- ambient dimension of a Polyhedron, Cone or Fan
- areCompatible(Cone,Cone), see areCompatible -- checks if the intersection of two cones/polyhedra is a face of each
- areCompatible(Polyhedron,Polyhedron), see areCompatible -- checks if the intersection of two cones/polyhedra is a face of each
- bipyramid(Polyhedron), see bipyramid -- computes the bipyramid over a polyhedron
`boundaryMap(ZZ,PolyhedralComplex)`(missing documentation)`boundaryMap(ZZ,Polyhedron)`(missing documentation)- cellDecompose(Polyhedron,Matrix), see cellDecompose -- computes the regular cell decomposition
- commonFace(Cone,Cone), see commonFace -- checks if the intersection is a face of both Cones or Polyhedra, or of cones with fans
- commonFace(Cone,Fan), see commonFace -- checks if the intersection is a face of both Cones or Polyhedra, or of cones with fans
- commonFace(Fan,Cone), see commonFace -- checks if the intersection is a face of both Cones or Polyhedra, or of cones with fans
- commonFace(Fan,Fan), see commonFace -- checks if the intersection is a face of both Cones or Polyhedra, or of cones with fans
- commonFace(Polyhedron,Polyhedron), see commonFace -- checks if the intersection is a face of both Cones or Polyhedra, or of cones with fans
- Cone * Cone -- computes the direct product of two cones
- Cone * Polyhedron -- computes the direct product of a cone and a polyhedron
- Cone + Cone -- computes the Minkowski sum of two cones
- Cone + Polyhedron -- computes the Minkowski sum of a cone and a polyhedron
- Cone == Cone -- equality
- Cone ? Cone -- compares the Cones
- cones(ZZ,Fan), see cones -- computes all cones of a fan of a certain dimension
- coneToPolyhedron(Cone), see coneToPolyhedron -- converts a cone to class Polyhedron
- contains(Cone,Cone), see contains -- checks if the first argument contains the second argument
- contains(Cone,Matrix), see contains -- checks if the first argument contains the second argument
- contains(Cone,Polyhedron), see contains -- checks if the first argument contains the second argument
- contains(Fan,Cone), see contains -- checks if the first argument contains the second argument
- contains(List,Cone), see contains -- checks if the first argument contains the second argument
- contains(List,Polyhedron), see contains -- checks if the first argument contains the second argument
- contains(Polyhedron,Cone), see contains -- checks if the first argument contains the second argument
- contains(Polyhedron,Matrix), see contains -- checks if the first argument contains the second argument
- contains(Polyhedron,Polyhedron), see contains -- checks if the first argument contains the second argument
- convexHull(Polyhedron,Polyhedron), see convexHull -- computing the convex hull of points, rays and polyhedra
- dim(Cone) -- computes the dimension of a cone
- dim(Fan) -- computes the dimension of a fan
- dim(PolyhedralComplex) -- computes the dimension of a polyhedral complex
- dim(Polyhedron) -- computes the dimension of a polyhedron
- directProduct(Cone,Cone) -- computes the direct product of polyhedra and cones
- directProduct(Cone,Polyhedron), see directProduct(Cone,Cone) -- computes the direct product of polyhedra and cones
- directProduct(Polyhedron,Cone), see directProduct(Cone,Cone) -- computes the direct product of polyhedra and cones
- directProduct(Polyhedron,Polyhedron), see directProduct(Cone,Cone) -- computes the direct product of polyhedra and cones
- directProduct(Fan,Fan) -- computes the direct product of two fans
`dualCayley(Polyhedron)`(missing documentation)`dualCayleyFace(Polyhedron)`(missing documentation)- dualCone(Cone), see dualCone -- computes the dual Cone
- dualFaceLattice(Cone), see dualFaceLattice(ZZ,Cone) -- computes the dual face lattice of a cone
- dualFaceLattice(ZZ,Cone) -- computes the dual face lattice of a cone
- dualFaceLattice(Polyhedron), see dualFaceLattice(ZZ,Polyhedron) -- computes the dual face lattice of a polyhedron
- dualFaceLattice(ZZ,Polyhedron) -- computes the dual face lattice of a polyhedron
- ehrhart(Polyhedron), see ehrhart -- calculates the Ehrhart polynomial of a polytope
- faceFan(Polyhedron), see faceFan -- computes the fan generated by the cones over the faces
- faceLattice(Cone), see faceLattice(ZZ,Cone) -- computes the face lattice of a cone
- faceLattice(ZZ,Cone) -- computes the face lattice of a cone
- faceLattice(Polyhedron), see faceLattice(ZZ,Polyhedron) -- computes the face lattice of a polyhedron
- faceLattice(ZZ,Polyhedron) -- computes the face lattice of a polyhedron
`faceOf(Polyhedron)`(missing documentation)- faces(ZZ,Cone), see faces -- computes all faces of a certain codimension of a Cone or Polyhedron
- faces(ZZ,Polyhedron), see faces -- computes all faces of a certain codimension of a Cone or Polyhedron
- fan(Cone), see fan -- generates a Fan
- Fan * Fan -- computes the direct product
- Fan == Fan -- equality
- fVector(Cone), see fVector -- computes the f-vector of a Cone or Polyhedron
- fVector(Polyhedron), see fVector -- computes the f-vector of a Cone or Polyhedron
- halfspaces(Cone), see halfspaces -- computes the defining half-spaces of a Cone or a Polyhedron
- halfspaces(Polyhedron), see halfspaces -- computes the defining half-spaces of a Cone or a Polyhedron
- hilbertBasis(Cone), see hilbertBasis -- computes the Hilbert basis of a Cone
- hyperplanes(Cone), see hyperplanes -- computes the defining hyperplanes of a Cone or a Polyhedron
- hyperplanes(Polyhedron), see hyperplanes -- computes the defining hyperplanes of a Cone or a Polyhedron
- imageFan(Matrix,Cone), see imageFan -- computes the fan of the image
- incompCones(Cone,Fan), see incompCones -- returns the pairs of incompatible cones
- incompCones(Fan,Cone), see incompCones -- returns the pairs of incompatible cones
- incompCones(Fan,Fan), see incompCones -- returns the pairs of incompatible cones
- incompPolyhedra(PolyhedralComplex,PolyhedralComplex), see incompPolyhedra -- returns the pairs of incompatible polyhedra
- incompPolyhedra(PolyhedralComplex,Polyhedron), see incompPolyhedra -- returns the pairs of incompatible polyhedra
- incompPolyhedra(Polyhedron,PolyhedralComplex), see incompPolyhedra -- returns the pairs of incompatible polyhedra
- inInterior(Matrix,Cone), see inInterior -- checks if a point lies in the relative interior of a Cone/Polyhedron
- inInterior(Matrix,Polyhedron), see inInterior -- checks if a point lies in the relative interior of a Cone/Polyhedron
- interiorLatticePoints(Polyhedron), see interiorLatticePoints -- computes the lattice points in the relative interior of a polytope
- interiorPoint(Polyhedron), see interiorPoint -- computes a point in the relative interior of the Polyhedron
- interiorVector(Cone), see interiorVector -- computes a vector in the relative interior of a Cone
- intersection(Cone,Cone), see intersection -- computes the intersection of half-spaces, hyperplanes, cones, and polyhedra
- intersection(Cone,Polyhedron), see intersection -- computes the intersection of half-spaces, hyperplanes, cones, and polyhedra
- intersection(Polyhedron,Cone), see intersection -- computes the intersection of half-spaces, hyperplanes, cones, and polyhedra
- intersection(Polyhedron,Polyhedron), see intersection -- computes the intersection of half-spaces, hyperplanes, cones, and polyhedra
- isCompact(Polyhedron), see isCompact -- checks compactness of a Polyhedron
- isComplete(Fan), see isComplete -- checks completeness of a Fan or PolyhedralComplex
- isComplete(PolyhedralComplex), see isComplete -- checks completeness of a Fan or PolyhedralComplex
- isEmpty(Polyhedron), see isEmpty -- checks if a Polyhedron is empty
- isFace(Cone,Cone), see isFace -- tests if the first argument is a face of the second
- isFace(Polyhedron,Polyhedron), see isFace -- tests if the first argument is a face of the second
- isLatticePolytope(Polyhedron), see isLatticePolytope -- checks if a polyhedron is a lattice polytope
- isNormal(Polyhedron) -- checks if a polytope is normal in the ambient lattice
- isPointed(Cone), see isPointed -- checks if a Cone or Fan is pointed
- isPointed(Fan), see isPointed -- checks if a Cone or Fan is pointed
- isPolytopal(Fan), see isPolytopal -- checks if a Fan is polytopal
- isPure(Fan), see isPure -- checks if a Fan or PolyhedralComplex is of pure dimension
- isPure(PolyhedralComplex), see isPure -- checks if a Fan or PolyhedralComplex is of pure dimension
- isReflexive(Polyhedron), see isReflexive -- checks if a Polytope is reflexive
- isSimplicial(PolyhedralObject), see isSimplicial -- checks if a polyhedral object is simplicial
- isSmooth(Cone), see isSmooth -- checks if a Cone or Fan is smooth
- isSmooth(Fan), see isSmooth -- checks if a Cone or Fan is smooth
- isVeryAmple(Polyhedron), see isVeryAmple -- checks if the Polyhedron is very ample
- latticePoints(Polyhedron), see latticePoints -- computes the lattice points of a polytope
- linSpace(Cone), see linSpace -- computes a basis of the lineality space
- linSpace(Fan), see linSpace -- computes a basis of the lineality space
- linSpace(Polyhedron), see linSpace -- computes a basis of the lineality space
- maxCones(Fan), see maxCones -- displays the generating Cones of a Fan
- maxFace(Matrix,Cone), see maxFace -- computes the face of a Polyhedron or Cone where a weight attains its maximum
- maxFace(Matrix,Polyhedron), see maxFace -- computes the face of a Polyhedron or Cone where a weight attains its maximum
- maxPolyhedra(PolyhedralComplex), see maxPolyhedra -- displays the generating Polyhedra of a PolyhedralComplex
- minFace(Matrix,Cone), see minFace -- computes the face of a Polyhedron or Cone where a weight attains its minimum
- minFace(Matrix,Polyhedron), see minFace -- computes the face of a Polyhedron or Cone where a weight attains its minimum
- minkowskiSum(Cone,Cone), see minkowskiSum -- computes the Minkowski sum of two convex objects
- minkowskiSum(Cone,Polyhedron), see minkowskiSum -- computes the Minkowski sum of two convex objects
- minkowskiSum(Polyhedron,Cone), see minkowskiSum -- computes the Minkowski sum of two convex objects
- minkowskiSum(Polyhedron,Polyhedron), see minkowskiSum -- computes the Minkowski sum of two convex objects
- minkSummandCone(Polyhedron), see minkSummandCone -- computes the Cone of all Minkowski summands and the minimal decompositions
- net(Cone) -- displays characteristics of a cone
- net(Fan) -- displays characteristics of a fan
- net(PolyhedralComplex) -- displays characteristics of a polyhedral complex
- net(Polyhedron) -- displays characteristics of a polyhedron
- normalCone(Polyhedron,Polyhedron) -- computes the normal cone of a face of a polyhedron
- normalFan(Polyhedron), see normalFan -- computes the normalFan of a polyhedron
- objectiveVector(Polyhedron,Polyhedron), see objectiveVector -- computes an objective vector of a face of a polyhedron
- polar(Polyhedron), see polar -- computes the polar of a polyhedron
- polarFace(Polyhedron), see polarFace -- computes the dual face of the polar polyhedron
- polyhedra(ZZ,PolyhedralComplex), see polyhedra -- computes all polyhedra of a polyhedral complex of a certain dimension
- polyhedralComplex(Polyhedron), see polyhedralComplex -- generates a PolyhedralComplex
- Polyhedron * Cone -- computes the direct product of a polyhedron and a cone
- Polyhedron * Polyhedron -- computes the direct product of two polyhedra
- Polyhedron + Cone -- computes the Minkowski sum of a polyhedron and a cone
- Polyhedron + Polyhedron -- computes the Minkowski sum of two polyhedra
- Polyhedron == Polyhedron -- equality
- polytope(Fan), see polytope -- returns a polytope of which the fan is the normal fan if it is polytopal
- posHull(Cone,Cone), see posHull -- computes the positive hull of rays, cones, and the cone over a polyhedron
- posHull(Polyhedron), see posHull -- computes the positive hull of rays, cones, and the cone over a polyhedron
- proximum(Matrix,Cone), see proximum -- computes the proximum of the Polyhedron/Cone to a point in euclidian metric
- proximum(Matrix,Polyhedron), see proximum -- computes the proximum of the Polyhedron/Cone to a point in euclidian metric
- pyramid(Polyhedron), see pyramid -- computes the pyramid over a polyhedron
- QQ * Polyhedron -- rescales a polyhedron by a given positive factor
- ZZ * Polyhedron, see QQ * Polyhedron -- rescales a polyhedron by a given positive factor
- rays(Cone), see rays -- displays all rays of a Cone, a Fan, or a Polyhedron
- rays(Fan), see rays -- displays all rays of a Cone, a Fan, or a Polyhedron
- rays(Polyhedron), see rays -- displays all rays of a Cone, a Fan, or a Polyhedron
- secondaryPolytope(Polyhedron), see secondaryPolytope -- computes the secondary polytope of a compact polyhedron
- skeleton(ZZ,Fan), see skeleton -- computes the k-skeleton of a Fan or PolyhedralComplex
- skeleton(ZZ,PolyhedralComplex), see skeleton -- computes the k-skeleton of a Fan or PolyhedralComplex
- smallestFace(Matrix,Cone), see smallestFace -- determines the smallest face of the Cone/Polyhedron containing a point
- smallestFace(Matrix,Polyhedron), see smallestFace -- determines the smallest face of the Cone/Polyhedron containing a point
- smoothSubfan(Fan), see smoothSubfan -- computes the subfan of all smooth cones
- stellarSubdivision(Fan,Matrix), see stellarSubdivision -- computes the stellar subdivision of the fan by a ray
- sublatticeBasis(Polyhedron), see sublatticeBasis -- computes a basis for the sublattice generated by integral vectors or the lattice points of a polytope
- tailCone(Polyhedron), see tailCone -- computes the tail/recession cone of a polyhedron
- toSublattice(Polyhedron), see toSublattice -- calculates the preimage of a polytope in the sublattice generated by its lattice points
- triangulate(Polyhedron), see triangulate -- computes a triangulation of a polytope
- vertexEdgeMatrix(Polyhedron), see vertexEdgeMatrix -- computes the vertex-edge-relations matrix
- vertexFacetMatrix(Polyhedron), see vertexFacetMatrix -- computes the vertex-facet-relations matrix
- vertices(PolyhedralComplex), see vertices -- displays the vertices of a Polyhedron or a PolyhedralComplex
- vertices(Polyhedron), see vertices -- displays the vertices of a Polyhedron or a PolyhedralComplex
- volume(Polyhedron), see volume -- computes the volume of a polytope