# 「BZOJ 2178」圆的面积并-格林公式

### 题解

#### 格林公式

$$\iint_{D}\frac{\partial Q}{\partial x}-\frac{\partial P}{\partial y}=\oint_{L^+} P \text{ d}x+Q \text{ d}y$$

#### 计算区域面积

$$A = \iint_{D}\text{d} A$$

$$A = \oint_{C}(L \text{ d}x + M \text{ d}y)$$

$$A = \oint_{C} x\text{ d}y = - \oint_{C}y \text{ d}x = \frac 1 2 \oint_{C}(-y \text{ d}x + x \text{ d}y)$$

$$\begin{cases}x=x_0+r\cdot \cos\theta \\ y=y_0+r\cdot \sin\theta\end{cases}$$

\begin{aligned}S &= A \\ &= \frac 1 2 \oint_{C}(-y \text{ d}x + x \text{ d}y) \\ &= \frac{1}{2}\int_{\theta_1}^{\theta_2} (x_0+r\cdot \cos\theta) \text{ d}(y_0+r\cdot \sin\theta)-(y_0+r\cdot \sin\theta) \text{ d}(x_0+r\cdot \cos\theta) \\ &= \frac{r}{2}\int_{\theta_1}^{\theta_2} [(x_0+r\cdot \cos\theta)\cdot \cos\theta +(y_0+r\cdot \sin\theta)\cdot \sin\theta ]\text{ d}\theta \\ &= \frac{r}{2}\int_{\theta_1}^{\theta_2} [x_0\cdot \cos\theta + y_0\cdot \sin\theta+r] \text{ d}\theta \\ &= \frac{1}{2}\cdot(f(r,x_0,y_0,\theta_2)-f(r,x_0,y_0,\theta_1))\end{aligned}

$$f(r,x,y,\theta)=r^2\cdot \theta+r\cdot x\cdot \sin\theta-r\cdot y\cdot \cos\theta$$