affineImage(Matrix,Polyhedron,Matrix) -- computes the affine image of a polyhedron

Synopsis

• Function: affineImage
• Usage:
P1 = affineImage(A,P,v)
P1 = affineImage(A,P)
P1 = affineImage(P,v)
• Inputs:
• A, , with entries in ZZ or QQ
• v, , with entries in ZZ or QQ and only one column representing a vector
• Outputs:
• P1,

Description

A must be a matrix from the ambient space of the polyhedron P to some other target space and v must be a vector in that target space, i.e. the number of columns of A must equal the ambient dimension of P and A and v must have the same number of rows. Then affineImage computes the polyhedron {(A*p)+v | p in P} where v is set to 0 if omitted and A is the identity if omitted.

For example, consider the following two dimensional polytope:

 i1 : P = convexHull matrix {{-2,0,2,4},{-8,-2,2,8}} o1 = {ambient dimension => 2 } dimension of lineality space => 0 dimension of polyhedron => 2 number of facets => 4 number of rays => 0 number of vertices => 4 o1 : Polyhedron

This polytope is the affine image of the square:

 i2 : A = matrix {{-5,2},{3,-1}} o2 = | -5 2 | | 3 -1 | 2 2 o2 : Matrix ZZ <--- ZZ i3 : v = matrix {{5},{-3}} o3 = | 5 | | -3 | 2 1 o3 : Matrix ZZ <--- ZZ i4 : Q = affineImage(A,P,v) o4 = {ambient dimension => 2 } dimension of lineality space => 0 dimension of polyhedron => 2 number of facets => 4 number of rays => 0 number of vertices => 4 o4 : Polyhedron i5 : vertices Q o5 = | -1 1 -1 1 | | -1 -1 1 1 | 2 4 o5 : Matrix QQ <--- QQ