Pick's Theorem Calculator
Work out the area of a lattice polygon from its interior and boundary grid points using Pick's theorem.
What it does
Pick's theorem replaces a geometry problem with a counting problem. For a polygon whose corners sit on an integer grid, the area is determined by how many grid points lie inside and how many lie on the boundary. The Cambridge paper carrying a formal proof of the theorem states it in one line: area equals I plus B over two minus one, where I counts interior lattice points and B counts boundary lattice points.
The result was published by Georg Alexander Pick in 1899. It is unusual because it needs no lengths, angles or coordinates beyond the fact that the vertices are lattice points. The Berkeley Math Circle notes introduce it with examples where the estimate I plus B over two is always off by exactly one, which is where the final subtraction comes from.
That simplicity has a boundary of its own. The polygon must be simple, meaning its edges meet only at shared vertices and there are no holes. A shape with a hole needs an extra term for each hole, and a polygon with a vertex between grid lines is outside the theorem entirely. The theorem also has no direct counterpart in three dimensions.
This page takes the two counts and returns the area, the boundary contribution, the total number of points counted and the number of primitive triangles. A primitive triangle is a lattice triangle with no other lattice points and an area of one half. Every simple lattice polygon can be cut into exactly twice its area of these small triangles.
The worked default uses a figure from the NYU Stomachion study, where a piece has 31 interior points and 15 boundary points. That example gives an area of 37.5 square units, and it is a useful check because the count and the area were published together rather than guessed from the formula.
How to use
- Draw or identify a simple polygon whose vertices all sit on integer grid coordinates.
- Count the grid points strictly inside the shape and enter them as interior lattice points.
- Count every grid point on the edges, including vertices, once each and enter it as boundary lattice points.
- Read the main result as the area in square grid units.
- Check the boundary contribution against B/2, then use the primitive triangle count as a second view of the same area.
- If the polygon has a hole, note that this tool does not apply and one must be added to the formula per hole.
Formula
- A
- Area of the polygon, in square grid units.
- I
- Number of integer grid points strictly inside the polygon.
- B
- Number of integer grid points lying on the boundary, vertices included.
- 2A
- Number of primitive triangles in any triangulation of the polygon.
A simple polygon has edges that meet only at their endpoints and no holes. For a polygon with h holes the extended form is A = I + B/2 - 1 + h, counting the points on each hole boundary as well. Because I and B are whole numbers, the area is always a whole number or a multiple of one half. Edges may be slanted; they only need to join lattice vertices.
Worked example
Example: a piece of the Stomachion
Defaults from the NYU Stomachion study: I = 31 interior lattice points and B = 15 boundary lattice points.
- Use the published counts I = 31 and B = 15.
- Halve the boundary count: B/2 = 15/2 = 7.5.
- Apply the formula: A = 31 + 7.5 - 1 = 37.5 square units.
- Total lattice points counted: I + B = 31 + 15 = 46 points.
- Primitive triangles: 2A = 2 x 37.5 = 75, because each primitive triangle has area one half.
- The tool shows 37.5 square units, 7.5 square units, 46 points and 75 primitive triangles.
Reference table
| Polygon example | Interior I | Boundary B | Area |
|---|---|---|---|
| Unit lattice triangle | 0 | 3 | 0.5 |
| Unit lattice square | 0 | 4 | 1 |
| Berkeley example D | 7 | 12 | 12 |
| Berkeley example C | 28 | 26 | 40 |
| NYU Stomachion piece | 31 | 15 | 37.5 |
Limits
- Applies only to simple polygons with vertices at integer coordinates. Fractional vertex coordinates fall outside the theorem.
- Polygons with holes need a correction term which this tool does not accept.
- The tool works from counts alone, so it cannot check whether a given pair of counts is realisable by an actual polygon.
- There is no direct three dimensional version, so the result is specific to the integer grid in the plane.
Common mistakes
- Counting a corner twice when adding up boundary points.
- Including points strictly inside the shape in the boundary count.
- Using the plain formula on a polygon with a hole without adding one for each hole.
- Assuming a unit lattice triangle has area one, when the correct area is one half.
- Applying the theorem to a polygon whose corners are not on grid intersections.
Try it yourself
Quick checks. Answers sit tucked under each question.
A lattice triangle has no interior points and three boundary points. What is its area?
A = 0 + 3/2 - 1 = 0.5 square units. This is the smallest area Pick's theorem produces.
A lattice polygon has 28 interior points and 26 boundary points. Find the area and the primitive triangle count.
A = 28 + 26/2 - 1 = 40 square units, and a triangulation contains 2 x 40 = 80 primitive triangles.
A lattice rectangle of area 12 has 14 boundary points. How many interior points does it have?
Rearrange to I = A - B/2 + 1 = 12 - 7 + 1 = 6 interior points, which matches a 3 by 4 grid rectangle.
Questions
What is Pick's theorem?
A formula stating that the area of a simple lattice polygon equals the number of interior lattice points plus half the number of boundary lattice points minus one.
What counts as a lattice point?
A point whose x and y coordinates are both integers, so it sits at an intersection of the grid lines.
Does it work for polygons with holes?
Not with the plain formula. Add one for each hole, giving A = I + B/2 - 1 + h, and count boundary points on the hole edges too.
Why is the area always a multiple of one half?
Both I and B are whole numbers, so B/2 is either a whole number or ends in one half, and subtracting one keeps the result on that half unit grid.
Must the edges follow grid lines?
No. Edges can be slanted. The only requirement is that each endpoint is a lattice point and that edges do not cross.
Can I use the theorem in three dimensions?
No direct version exists. Pick's theorem is a two dimensional result about the integer grid in the plane, though related higher dimensional analogues have been studied.
Sources
- Berkeley Math Circle, Pick's Theorem lecture notes by Tom Davis
- Cambridge University, John Harrison: A formal proof of Pick's theorem
- New York University, Archimedes' Stomachion and Pick's Theorem