Pick's Theorem: Area by Counting Points

Put a polygon's corners on the points of a square grid, by clicking or by choosing a preset. The page counts the grid points inside it and on its edges, works out the area both from those counts and from the corners' coordinates, and shows the two agree. The table under the drawing does the counting and the arithmetic.

Loading interactive simulation...

Lesson

The theory — Pick's Theorem: Area by Counting Points

A lattice polygon is a simple polygon whose corners are points of the square grid with integer coordinates. Pick's theorem says its area is A = I + B ÷ 2 − 1, where I is the number of grid points strictly inside and B the number on its edges, corners included. An edge from one grid point to another passes through gcd(|Δx|, |Δy|) grid steps, so B is the sum of those over the edges. A polygon with h holes has A = I + B ÷ 2 + h − 1, with the holes' edges counted in B.

What each symbol means

I
the grid points strictly inside the polygon
B
the grid points on its edges, corners included. Each edge contributes gcd(|Δx|, |Δy|)
A
the area, in grid squares. Always a multiple of ½
h
the number of holes. Each adds one to the formula

Count the dots and you have the area 🖖

Press Four-point star. The polygon has 53 grid points inside and 8 on its edges, and its area is 53 + 8 ÷ 2 − 1 = 56. The shoelace formula, which works from the corners' coordinates and never counts anything, gives 56 as well. That is Pick's theorem, published by Georg Pick in 1899: for any simple polygon, one boundary with no crossings and no holes, whose corners sit on grid points, the area is I + B ÷ 2 − 1, where I counts the points inside and B the points on the boundary. Drag a corner and both numbers move together. No ruler, no subtraction of triangles, no approximation: the area of such a polygon is fixed by two whole numbers.

Every empty triangle has area one half 🖖

Press Thin triangle. It is 13 units across and looks almost like a line, and apart from its three corners it touches no grid point at all. Its area is exactly ½. Every lattice triangle with no other grid points in or on it has that area, however long or thin, and this is what the theorem rests on: any simple lattice polygon can be cut into such triangles, 2I + B − 2 of them, and two more for each hole. Press Four-point star, turn on Show primitive triangles and count them: 112 triangles of ½ each, 56 in all.

In three dimensions the two counts are not enough 🖖

Press Reeve, r = 5. Its four corners are grid points, and no other grid point lies in it or on it, whatever its height. Its volume is the height divided by 6: 5 ÷ 6 at a height of 5, and the table lists heights 1 to 10 with ten different volumes beside the same counts, no points inside and four on the boundary. A formula that turned those two counts into a volume would have to give ten different answers from one input. John Reeve found this solid in 1957, and it is the reason Pick's theorem has no three-dimensional version of the same kind.

Problem solved in full

  1. The area of a square, by counting 5 steps

    A square has corners at (2, 2), (6, 2), (6, 6) and (2, 6). Find its area by counting grid points with Pick's theorem, check it with the shoelace formula, and say what the counts become when the square is doubled. Press Square to check.

    Open this problem in the tool

    1. Each edge runs 4 units along a grid line, so it has gcd(4, 0) = 4 steps, and the boundary count is:

    2. The points strictly inside form a 3 by 3 block:

    3. Pick's theorem:

    4. The shoelace formula from the corners, for comparison:

    5. Doubled, the square is 8 by 8, with 7 by 7 points inside and 32 on the edges:

    Answer

    The area is 16 by counting and 16 by coordinates. Doubled, the counts are 49 inside and 32 on the edges, and the area is 64, four times as much. The boundary count only doubled, so to make the area four times as large the interior count had to grow faster, from 9 to 49: a doubled polygon always has 4I + B − 3 points inside.