Home Online Manual
Top
Back: cycleLength
Forward: eta
FastBack:
FastForward:
Up: polymake_lib
Top: Singular Manual
Contents: Table of Contents
Index: Index
About: About this document

D.13.4.4 splitPolygon

Procedure from library polymake.lib (see polymake_lib).

Usage:
splitPolygon (markings); markings list

Assume:
markings is a list of integer vectors representing lattice points in the plane which we consider as the marked points of the convex lattice polytope spanned by them

Purpose:
split the marked points in the vertices, the points on the facets which are not vertices, and the interior points

Return:
list, L consisting of three lists
L[1] : represents the vertices the polygon ordered clockwise
L[1][i][1] = intvec, the coordinates of the ith vertex
L[1][i][2] = int, the position of L[1][i][1] in markings
L[2][i] : represents the lattice points on the facet of the polygon with endpoints L[1][i] and L[1][i+1]
(i considered modulo size(L[1]))
L[2][i][j][1] = intvec, the coordinates of the jth lattice point on that facet
L[2][i][j][2] = int, the position of L[2][i][j][1] in markings
L[3] : represents the interior lattice points of the polygon
L[3][i][1] = intvec, coordinates of ith interior point
L[3][i][2] = int, the position of L[3][i][1] in markings

Example:
 
LIB "polymake.lib";
// the lattice polygon spanned by the points (0,0), (3,0) and (0,3)
// with all integer points as markings
list polygon=intvec(1,1),intvec(3,0),intvec(2,0),intvec(1,0),
intvec(0,0),intvec(2,1),intvec(0,1),intvec(1,2),
intvec(0,2),intvec(0,3);
// split the polygon in its vertices, its facets and its interior points
list sp=splitPolygon(polygon);
// the vertices
sp[1];
==> [1]:
==>    [1]:
==>       3,0
==>    [2]:
==>       2
==> [2]:
==>    [1]:
==>       0,0
==>    [2]:
==>       5
==> [3]:
==>    [1]:
==>       0,3
==>    [2]:
==>       10
// the points on facets which are not vertices
sp[2];
==> [1]:
==>    [1]:
==>       [1]:
==>          2,0
==>       [2]:
==>          3
==>    [2]:
==>       [1]:
==>          1,0
==>       [2]:
==>          4
==> [2]:
==>    [1]:
==>       [1]:
==>          0,1
==>       [2]:
==>          7
==>    [2]:
==>       [1]:
==>          0,2
==>       [2]:
==>          9
==> [3]:
==>    [1]:
==>       [1]:
==>          1,2
==>       [2]:
==>          8
==>    [2]:
==>       [1]:
==>          2,1
==>       [2]:
==>          6
// the interior points
sp[3];
==> [1]:
==>    [1]:
==>       1,1
==>    [2]:
==>       1