Solution (source code)

= Solution

For an oriented piecewise smooth surface $S$ with boundary $C=\partial S$ and a vector field $\mathbf A$ with continuous first derivatives near $S$, the <Stokes theorem> states
$$
\boxed{\oint_C\mathbf A\cdot d\mathbf r=\int_S(\nabla\times\mathbf A)\cdot\mathbf n\,dS.}
$$
Here $\mathbf n$ is the chosen unit <normal vector>, $dS$ the positive area element, and $d\mathbf r$ the oriented tangent line element. The traversal of $C$ follows the right-hand rule relative to the surface orientation.