Area by shoelace
Tap grid points to place the corners of a polygon, going round in order. Drag a corner to move it. From the third corner on, the table shows the shoelace formula line by line: for each corner multiply its x by the next corner's y, subtract the next x times this y, add up, halve. Tick grid count to shade the squares whose centre is inside and compare the count with the formula, then compare both with Pick's dot count.
What's going on
Write the corners in a column, (x₁, y₁) down to (xₙ, yₙ), then repeat the first corner at the bottom. Multiply diagonally down-right (x₁y₂, x₂y₃, …) and diagonally down-left (y₁x₂, y₂x₃, …), like lacing a shoe. Subtract the second total from the first and halve. The result is the area, with a sign: positive if you went round anticlockwise, negative if clockwise. Take the absolute value.
Why it works: each term (xᵢyᵢ₊₁ − xᵢ₊₁yᵢ)/2 is the signed area of the triangle made by the origin and one edge. Going round the polygon, the triangles outside it get counted once positive and once negative and cancel; the inside is counted exactly once.
The grid count shades every unit square whose centre lies inside. It is only an estimate, since edges slice through squares, but it is usually within a square or two. Pick's theorem is exact for corners on grid points: area = (dots strictly inside) + (dots on the edge)/2 − 1. Three ways to the same number.
If your edges cross each other, the formula still gives a number but it is no longer the area: the two loops are counted with opposite signs. The demo warns you when that happens, and also when edges only touch or double back, because Pick's count needs an outline that never meets itself.
Sheet: The shoelace formula.