# halfspaces -- computes the defining half-spaces of a Cone or a Polyhedron

## Synopsis

• Usage:
M = halfspaces C
(M,v) = halfspaces P
• Inputs:
• Outputs:
• M, , with entries over QQ
• v, , with entries over QQ and only one column

## Description

halfspaces returns the defining affine half-spaces. For a polyhedron P the output is (M,v), where the source of M has the dimension of the ambient space of P and v is a one column matrix in the target space of M such that P = {p in H | M*p =< v} where H is the intersection of the defining affine hyperplanes.

For a cone C the output is the matrixM that is the same matrix as before but v is omitted since it is 0, so C = {c in H | M*c => 0} and H is the intersection of the defining linear hyperplanes.

Please see V- and H-representation on the conventions we use for cones and polyhedra.

 i1 : R = matrix {{1,1,2,2},{2,3,1,3},{3,2,3,1}}; 3 4 o1 : Matrix ZZ <--- ZZ i2 : V = matrix {{1,-1},{0,0},{0,0}}; 3 2 o2 : Matrix ZZ <--- ZZ i3 : C = coneFromVData R o3 = C o3 : Cone i4 : halfspaces C o4 = | -2 1 1 | | 1 -1 1 | | 1 1 -1 | | 5 -1 -1 | 4 3 o4 : Matrix ZZ <--- ZZ

Now we take this cone over a line and get a polyhedron.

 i5 : P = convexHull(V,R) o5 = P o5 : Polyhedron i6 : halfspaces P o6 = (| 0 1 -3 |, | 0 |) | 2 -1 -1 | | 2 | | -1 1 -1 | | 1 | | 0 -3 1 | | 0 | | -1 -1 1 | | 1 | | -5 1 1 | | 5 | o6 : Sequence

## Ways to use halfspaces :

• "halfspaces(Cone)"
• "halfspaces(Polyhedron)"

## For the programmer

The object halfspaces is .