API
The database can be queried as JSON. Invalid parameters return status 400 with a field error.
Identify accepts at most 25 vertices and denominators up to 25.
Identify
GET /polygons/api/v1/identify?vertices=(-1,-1),(2,-1),(-1,2)
{
"in_database": true,
"polygon": {...}
}
| Field | Meaning |
|---|---|
in_database | Whether the polygon is in the database |
polygon | The convex hull of the given points, described below |
The parameter vertices is a comma-separated list of coordinates, which may be fractions like 1/2.
Search
GET /polygons/api/v1/search?k=2&i=1&page=1
{
"total": 5129,
"page": 1,
"pages": 86,
"page_size": 60,
"complete": true,
"incomplete_reason": null,
"polygons": [{...}, ...]
}
| Field | Meaning |
|---|---|
total | Number of polygons matching the search |
page, pages | Number of this page and of all pages |
page_size | Maximal number of polygons per page |
complete | Whether the database contains all polygons matching the search |
incomplete_reason | Which polygons may be missing, or null |
polygons | The polygons on this page, described below |
The parameters are those of the search form, as in the address of a search, and page.
Polygons
{
"url": "/polygons/polygon/1/3,0,0,3,0,0",
"vertices": [["3", "0"], ["0", "3"], ["0", "0"]],
"denominator": 1,
"interior_lattice_points": 1,
"boundary_lattice_points": 9,
"area": "9/2",
"number_of_vertices": 3,
"boundary_k_rational_points": 9,
"ehrhart_period": 1,
"automorphism_group": "D3",
"maximal": true,
"integer_hull_dimension": 2,
"interior_integer_hull_dimension": 0,
"ldp": true,
"thin": null
}
| Field | Meaning |
|---|---|
url | Page of the polygon |
vertices | Vertices in affine normal form, with coordinates as strings |
denominator | Smallest k such that kP has integral vertices |
interior_lattice_points | Number of interior lattice points |
boundary_lattice_points | Number of boundary lattice points |
area | Euclidean area, as a string |
number_of_vertices | Number of vertices |
boundary_k_rational_points | Number of points of (1/k)ℤ² on the boundary, where k is the denominator |
ehrhart_period | Period of the Ehrhart quasipolynomial |
automorphism_group | Group of affine unimodular automorphisms: Zn cyclic, Dn dihedral of order 2n |
maximal | Whether the polygon is maximal |
integer_hull_dimension | Dimension of the convex hull of the lattice points, −1 if there are none |
interior_integer_hull_dimension | Dimension of the convex hull of the interior lattice points, −1 if there are none |
ldp | Whether the polygon is LDP; null unless it has one interior lattice point |
thin | Whether the polygon is thin; null unless it has no interior lattice points |