# Singular

#### D.13.1.8 secondaryFan

Procedure from library `polymake.lib` (see polymake_lib).

Usage:
secondaryFan(polygon[,#]); list polygon, list #

Assume:
- polygon is a list of integer vectors of the same size representing the affine coordinates of lattice points
- if the triangulations of the corresponding polygon have already been computed with the procedure triangulations then these can be given as a second (optional) argument in order to avoid doing this computation again

Purpose:
the procedure considers the marked polytope given as the convex hull of the lattice points and with these lattice points as markings; it then computes the lattice points of the secondary polytope given by this marked polytope which correspond to the triangulations computed by the procedure triangulations

Return:
list, the ith entry of L[1] contains information about the ith cone in the secondary fan of the polygon, i.e. the cone dual to the ith vertex of the secondary polytope
L[1][i][1] = integer matrix representing the inequalities which describe the cone dual to the ith vertex
L[1][i][2] = a list which contains the inequalities represented by L[1][i][1] as a list of strings, where we use the
variables x(1),...,x(n)
L[1][i][3] = only present if 'er' is set to 1; in that case it is an interger matrix whose rows are the extreme rays
of the cone
L[2] = is an integer matrix whose rows span the linearity space of the fan, i.e. the linear space which is contained in each cone
L[3] = the secondary polytope in the format of the procedure polymakePolytope
L[4] = the list of triangulations corresponding to the vertices of the secondary polytope

Note:
- the procedure calls for its computation polymake by Ewgenij Gawrilow, TU Berlin and Michael Joswig, so it only works if polymake is installed; see http://www.math.tu-berlin.de/polymake/
- in the optional argument # it is possible to hand over other names for the variables to be used -- be careful, the format must be correct and that is not tested, e.g. if you want the variable names to be u00,u10,u01,u11 then you must hand over the string 'u11,u10,u01,u11'
- if the triangluations are not handed over as optional argument the procedure calls for its computation of these triangulations the program points2triangs from the program topcom by Joerg Rambau, Universitaet Bayreuth; it therefore is necessary that this program is installed in order to use this procedure; see
http://www.uni-bayreuth.de/departments/wirtschaftsmathematik/rambau/TOPCOM

Example:
 ```LIB "polymake.lib"; // the lattice points of the unit square in the plane list polygon=intvec(0,0),intvec(0,1),intvec(1,0),intvec(1,1); // the secondary polytope of this lattice point configuration is computed list secfan=secondaryFan(polygon); // the number of cones in the secondary fan of the polygon size(secfan[1]); // the inequalities of the first cone as matrix are: print(secfan[1][1][1]); // the inequalities of the first cone as string are: print(secfan[1][1][2]); // the rows of the following matrix are the extreme rays of the first cone: print(secfan[1][1][3]); // each cone contains the linearity space spanned by: print(secfan[2]); // the points in the secondary polytope print(secfan[3][1]); // the corresponding triangulations secfan[4]; ```