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 = P
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 = Q
o4 : Polyhedron
|
i5 : vertices Q
o5 = | -1 1 -1 1 |
| -1 -1 1 1 |
2 4
o5 : Matrix QQ <--- QQ
|