Level-line curvature (source code)

= Level-line curvature
{title2=$\kappa=\operatorname{div}(\nabla u/|\nabla u|)$}

At a regular planar <level set> of a twice differentiable function, its oriented <curvature> with normal $\nabla u/|\nabla u|$ is $\kappa=(\Delta u-\nabla u^T(D^2u)\nabla u/|\nabla u|^2)/|\nabla u|$. Zero <curvature> at a point gives second-order contact with the tangent line, not a whole straight segment. For example the regular zero level line of $u(x,y)=y+x^3$ has zero <curvature> at the origin but is curved nearby.