Type any surface z = f(x, y) and see its curvature painted onto it: warm where it bends like a dome (K > 0), cool where it curves like a saddle (K < 0). Move a probe to get the tangent plane, normal, gradient, Hessian, principal curvatures and a classification of the point as a peak, pit or saddle — multivariable calculus you can see.
Use x and y with + − * / ^ and sin cos tan exp ln sqrt abs sinh cosh tanh, pi, e — e.g. sin(x)cos(y), exp(-(x^2+y^2)).
At every point the surface has a gradient ∇f = (fₓ, f_y), the direction of steepest ascent, and a tangent plane z = f(x₀,y₀) + fₓ(x − x₀) + f_y(y − y₀). The upward unit normal is (−fₓ, −f_y, 1)/√(1 + fₓ² + f_y²).
Bending is measured by the second derivatives, collected in the Hessian [[fₓₓ, fₓᵧ],[fₓᵧ, fᵧᵧ]]. For a graph surface the Gaussian curvature is K = (fₓₓfᵧᵧ − fₓᵧ²) / (1 + fₓ² + f_y²)² and the mean curvature is H = ((1 + f_y²)fₓₓ − 2fₓf_yfₓᵧ + (1 + fₓ²)fᵧᵧ) / (2(1 + fₓ² + f_y²)^{3/2}). The principal curvatures are κ₁,₂ = H ± √(H² − K): the greatest and least bending over all directions, along perpendicular principal directions (eigenvectors of the shape operator, drawn in gold and cyan).
K > 0 means an elliptic point (dome or bowl), K < 0 a hyperbolic point (saddle), K = 0 a parabolic point (cylinder-like). Gauss's Theorema Egregium says K depends only on distances measured within the surface — which is why you cannot flatten an orange peel without tearing it, yet you can roll paper into a cylinder. Surfaces with H = 0 everywhere are minimal surfaces — soap films.
Critical points (∇f = 0) are sorted with the second-derivative test: D = fₓₓfᵧᵧ − fₓᵧ². D > 0 with fₓₓ > 0 is a local minimum, D > 0 with fₓₓ < 0 a local maximum, D < 0 a saddle, and D = 0 is inconclusive. They are found by Newton's method from a grid of starting points and marked on the surface.
Worked example: for x² − y² at the origin, fₓₓ = 2 and fᵧᵧ = −2, so K = −4 and H = 0 — a saddle with principal curvatures ±2. Derivatives are central finite differences, accurate to about 6 significant figures for smooth functions.