几何

皮克定理

对于顶点落在格点上的任意多边形,面积 = I + B/2 − 1,其中 I 是内部格点数,B 是边界格点数。选一个形状来数一数。

5 分钟难度 1/3交互演示区域不展示广告。
Interior I25Boundary B24I + B/2 − 136.0Actual area36.0

Interior points (green) I = 25, boundary points (amber) B = 24. Pick’s formula gives I + B/2 − 1 = 36.0, matching the actual area 36.0.

Pick’s theorem: for a polygon whose vertices are lattice points, Area = I + B/2 − 1, where I counts interior grid points and B counts boundary grid points. Try the different shapes and watch both sides match.

你看到的是什么

1

数出严格位于多边形内部的格点,即 I。

2

数出位于边界上的格点,即 B。

3

那么面积 = I + B/2 − 1 就等于真实面积。

为什么重要

皮克定理把面积变成简单的计数,把几何与整数格上的组合联系起来。

复杂度与细节

计数为 O(网格面积),用 gcd 求边界为 O(边数)。

常见问题

必须是格点多边形吗?+

是的——每个顶点都必须是格点,否则公式不成立。