Understanding the Pick’s theorem calculator — concept and principle
Pick’s theorem gives the area of a polygon drawn on a square grid simply by counting dots. If every corner of the polygon sits on a lattice point (a point with whole-number coordinates), you only need two counts: the lattice points strictly inside, I, and the lattice points on the boundary, B. It is a favourite tool in mathematics competitions, and a quick check for shoelace-formula results.
How it is calculated
A = I + B/2 − 1
- I (interior points): lattice points strictly inside the polygon.
- B (boundary points): lattice points on the edges, including every vertex.
The area is in grid squares. If the grid spacing is 1 cm, the area is in cm². On an edge from (x₁, y₁) to (x₂, y₂), the number of lattice points, counting one endpoint, is gcd(|x₂ − x₁|, |y₂ − y₁|), so B is the sum of these over all edges.
The principle
Think of each lattice point as owning a share of the area around it. An interior point contributes a full unit. A boundary point on a straight stretch of edge has half its surroundings inside the polygon, so it contributes ½. At the corners the shares do not quite add up: going around a polygon, the exterior turning angles total 360°, a full turn, and that missing turn costs exactly one unit, hence the −1. A formal proof checks that the formula holds for a single triangle containing no other lattice points (area ½) and that it stays true when polygons are glued along an edge. Georg Pick published the result in 1899.
Worked example
- Inputs: I = 7, B = 8.
- Half the boundary points: 8 ÷ 2 = 4.
- Area = 7 + 4 − 1 = 10.
- One polygon with these counts is the triangle (0, 0), (0, 5), (4, 2): its edges contribute 5 + 2 + 1 = 8 boundary points, and the shoelace formula gives the same area, |0×5 − 4×5| ÷ 2 = 10.
| Interior lattice points I | Area |
|---|---|
| 1.75 | 4.75 |
| 3.5 | 6.5 |
| 5.25 | 8.25 |
| 7 | 10 |
| 8.75 | 11.75 |
| 10.5 | 13.5 |
| 14 | 17 |
How to read the result
The area of a lattice polygon is always a whole number or a whole number plus one half, because B/2 can only add a half. If B is odd, the area ends in .5. As a cross-check, a 4 × 3 rectangle has B = 14 and I = 6, so A = 6 + 7 − 1 = 12.
Common mistakes
- Forgetting the vertices when counting B, or counting them twice.
- Counting points that lie on an edge as interior points.
- Applying the theorem when a vertex is not on a lattice point.
Frequently asked questions
What if the polygon has holes?
For a polygon with h holes the formula becomes A = I + B/2 + h − 1.
Can Pick’s theorem work on a triangular grid?
Not in this form; it is stated for the square integer lattice and needs adjustment for other lattices.
How do I count boundary points quickly?
For each edge, take the gcd of the absolute differences in x and in y, then add the results for all edges.
Sources: G. Pick, Geometrisches zur Zahlenlehre, Sitzungsberichte des deutschen naturwissenschaftlich-medicinischen Vereines für Böhmen “Lotos” in Prag 19 (1899), 311–319 · J. E. Reeve, On the volume of lattice polyhedra, Proceedings of the London Mathematical Society (1957)