Signed area as a boundary integral (source code)

= Signed area as a boundary integral
{title2=$A=\frac12\oint_C(x\,dy-y\,dx)$}

For a counterclockwise, piecewise smooth simple closed planar curve $C$ enclosing $D$, <Green's theorem> with $P=-y/2$ and $Q=x/2$ gives $\frac12\oint_C(x\,dy-y\,dx)=\iint_D1\,dx\,dy$. The integral is the <area> of $D$ with a sign determined by the traversal direction. For <polar coordinates> $x=r\cos\theta$, $y=r\sin\theta$, differentiation gives $x\,dy-y\,dx=r^2d\theta$, yielding the familiar polar area formula when the curve is traversed once.