|
本帖最后由 hbghlyj 于 2025-3-3 19:43 编辑 鞋带公式:二维多边形的面积\[A = \dfrac{1}{2} \left|\sum_{i=1}^n{(x_{i+1}+x_i)(y_{i+1}-y_i)}\right|\]或者写成行列式\[A = \dfrac{1}{2} \left|\sum_{i=1}^n{\det\begin{pmatrix}x_i&x_{i+1}\\y_i&y_{i+1}\end{pmatrix}}\right|\]其中$x_{n+1} = x_1$ and $y_{n+1} = y_1$.
aops_wiki
第一种证明:$S=\sum_{i=1}^n\S{OA_iA_{i+1}}=\frac12\sum_{i=1}^n\overrightarrow{OA_i}\wedge\overrightarrow{OA_{i+1}}$
第二种证明:将多边形分割成三角形,对边数归纳
We cut $A_1A_2A_3...A_nA_{n+1}$ into two polygons, $A_1A_2A_3...A_n$ and $A_1A_nA_{n+1}$. Let the coordinates of point $A_i$ be $(x_i, y_i)$. Then, applying the shoelace theorem on $A_1A_2A_3...A_n$ and $A_1A_nA_{n+1}$ we get
\[[A_1A_2A_3...A_n]=\frac{1}{2}\sum_{i=1}^{n}(x_iy_{i+1}-x_{i+1}y_i)\]\[[A_1A_nA_{n+1}]=\frac{1}{2}(x_1y_2+x_2y_3+x_3y_1-x_1y_3-x_2y_1-x_3y_2)\]
Hence
\[[A_1A_2A_3...A_nA_{n+1}]=[A_1A_2A_3...A_n]+[A_1A_nA_{n+1}]=\frac{1}{2}\sum_{i=1}^{n}(x_iy_{i+1}-x_{i+1}y_i)+\frac{1}{2}(x_1y_2+x_2y_3+x_3y_1-x_1y_3-x_2y_1-x_3y_2)\]\[=\frac{1}{2}((x_2y_1+x_3y_2+...+x_{n+1}y_n+x_1y_{n+1})-(x_1y_2+x_2y_3+...+x_ny_{n+1}+x_{n+1}y_1))=\boxed{\frac{1}{2}\sum_{i=1}^n(x_iy_{i+1}-x_{i+1}y_i)}\]
As claimed.
第三种证明: go through trapezoids whose one side is a side of the polygon, and another side lies on the horizontal line y=0.
The area of such a trapezoid is
$$
\left(x_{i+1}-x_{i}\right) \frac{y_{i}+y_{i+1}}{2}
$$
where the vertices of the polygon are $p_{i}$ and $p_{i+1}$. If $x_{i+1}>x_{i}$, the area is positive, and if $x_{i+1}<x_{i}$, the area is negative.
The area of the polygon is the sum of areas of all such trapezoids, which yields the formula
$$
\left|\sum_{i=1}^{n-1}\left(x_{i+1}-x_{i}\right) \frac{y_{i}+y_{i+1}}{2}\right|=\frac{1}{2}\left|\sum_{i=1}^{n-1}\left(x_{i} y_{i+1}-x_{i+1} y_{i}\right)\right| .
$$
Note that the absolute value of the sum is taken, because the value of the sum may be positive or negative, depending on whether we walk clockwise or counterclockwise along the boundary of the polygon.
--(7,3)--(7,0)--(5,0)--cycle;%0D%0A%5Cdraw(4,1)node%7B%7D--(7,3)node%7B%7D--(5,5)node%7B%7D--(2,4)node%7B%7D--(4,3)node%7B%7D--cycle%20(1,0)--(8,0);%0D%0A%5Cend%7Btikzpicture%7D)
第四种证明:该公式也可以被认为是格林定理的一个特殊情况:$$\tilde{A}=\iint\left(\frac{\partial M}{\partial x}-\frac{\partial L}{\partial y}\right)dxdy=\oint(Ldx+Mdy)$$取$L=-y$与$M=0$,故$\tilde{A}=A$.
Let $\Omega$ be the set of points belonging to the polygon. We have that\[A=\int_{\Omega}\alpha,\]where $\alpha=dx\wedge dy$. The volume form $\alpha$ is an exact form since $d\omega=\alpha$, where\[\omega=\frac{x\,dy}{2}-\frac{y\,dx}{2}.\label{omega}\]Using this substitution, we have\[\int_{\Omega}\alpha=\int_{\Omega}d\omega.\]Next, we use the Theorem of Stokes to obtain\[\int_{\Omega}d\omega=\int_{\partial\Omega}\omega.\]We can write $\partial \Omega=\bigcup A(i)$, where $A(i)$ is the line segment from $(x_i,y_i)$ to $(x_{i+1},y_{i+1})$. With this notation, we may write\[\int_{\partial\Omega}\omega=\sum_{i=1}^n\int_{A(i)}\omega.\]If we substitute for $\omega$, we obtain\[\sum_{i=1}^n\int_{A(i)}\omega=\frac{1}{2}\sum_{i=1}^n\int_{A(i)}{x\,dy}-{y\,dx}.\]If we parameterize, we get\[\frac{1}{2}\sum_{i=1}^n\int_0^1{(x_i+(x_{i+1}-x_i)t)(y_{i+1}-y_i)}-{(y_i+(y_{i+1}-y_i)t)(x_{i+1}-x_i)\,dt}.\]Performing the integration, we get\[\frac{1}{2}\sum_{i=1}^n\frac{1}{2}[(x_i+x_{i+1})(y_{i+1}-y_i)- (y_{i}+y_{i+1})(x_{i+1}-x_i)].\]More algebra yields the result\[\frac{1}{2}\sum_{i=1}^n(x_iy_{i+1}-x_{i+1}y_i).\]
ximera.osu.edu/mooculus/calculus3/greensTheorem/digInGreensTheoremAsAPlanimeter
$\def\d{~\mathrm{d}}\def\vector#1{⟨#1⟩}\def\vec#1{{\bf\overset{⇀}{#1}}}\def\curl{{\bf\nabla\times}}$
Shoelace Algorithm
Given a polygon $P$ with vertices at $ (x_1,y_1),(x_2,y_2),\dots ,(x_n,y_n) $ we may compute the area of the polygonal region $R$ by setting $(x_{n+1},y_{n+1}) = (x_1,y_1)$ and computing: $$\text {area} = \frac {1}{2}\left |\sum _{i=1}^n \left (x_iy_{i+1} - x_{i+1}y_i\right )\right | $$To start, recall that if $\vec {F} = \vector {0,x}$, then $\curl \vec {F}(x,y) = 1$. Hence Green’s Theorem states: $ \iint _R \d A = \oint _P x\d y $ This means we can compute the area of the region $R$, by evaluating the line integral on the right along the polygonal boundary $P$. Since we’re supposing that the vertices of the polygon are$$ (x_1,y_1),(x_2,y_2),\dots ,(x_n,y_n)$$$P$ can be broken into $n$ edges, (if a polygon has $n$ vertices, it has $n$ edges). We can parameterize each edge as $$\begin{align*} E_1 &: \vector{x_1,y_1} + t \vector{x_2-x_1,y_2-y_1}\\ E_2 &: \vector{x_2,y_2} + t \vector{x_3-x_2,y_3-y_2}\\ E_3 &: \vector{x_3,y_3} + t \vector{x_4-x_3,y_4-y_3}\\ &\vdots\\ E_n &: \vector{x_n,y_n} + t \vector{x_n-x_1,y_n-y_1} \end{align*}$$ with $0\le t<1$. Moreover $$ \begin{align*} \iint_R \d A &= \oint_P x\d y\\ &= \sum_{i=1}^n \int_{E_i} x\d y, \end{align*}$$ this is just saying that the line integral along the perimeter of the polygon is the sum of the line integrals along the edges. Now write with me $$\begin{align*} \int_{E_i} x \d y &= \int_0^1 (x_i + t x_{i+1}-t x_i) (y_{i+1}-y_i) \d t\\ %&= \int_0^1 (x_i y_{i+1}+ t x_{i+1} y_{i+1}-t x_iy_{i+1} - x_iy_i - tx_{i+1}y_i+tx_iy_i) \d t\\ %&= x_i y_{i+1}+ \frac{x_{i+1} y_{i+1}}{2}- \frac{x_iy_{i+1}}{2} - x_iy_i - \frac{x_{i+1}y_i}{2}+\frac{x_iy_i}{2}
\\ &=\frac{1}{2}(x_i y_{i+1}+ x_{i+1} y_{i+1} - x_iy_i - x_{i+1}y_i) \end{align*}$$ So now we may write $$\begin{align*} \iint_R \d A &= \oint_P x\d y\\ &= \sum_{i=1}^n \int_{E_i} x\d y\\ &= \frac{1}{2}\sum_{i=1}^n (x_i y_{i+1}+ x_{i+1} y_{i+1} - x_iy_i - x_{i+1}y_i) \end{align*}$$ Noting that the terms $x_{i+1} y_{i+1}$ and $x_iy_i$ will cancel with each other as we cycle through the sum, we find that $$ \begin{align*} \iint_R \d A &= \oint_P x\d y\\ &= \frac{1}{2} \sum_{i=1}^n \left(x_iy_{i+1} - x_{i+1}y_i\right) \end{align*}$$ Since this value relies on $P$ being parameterized in a counterclockwise fashion, we take the absolute value to ensure a correct answer (just in case the young geometer accidentally parameterized in a clockwise fashion). Thus we have completed the explanation of the shoelace algorithm. |
|