Topic

Surfaces and curvature

A surface is three formulas in two parameters. surface returns its two fundamental forms, its normal, and its Gaussian, mean and principal curvatures, as formulas and as certified values, and says what kind of point each point is.

const torus = surface(["(2 + cos(v))*cos(u)", "(2 + cos(v))*sin(u)", "sin(v)"], ["u", "v"]);
torus.first();        // { E: "cos(v)^2 + 4*cos(v) + 4", F: "0", G: "1" }
torus.gaussian();     // "cos(v)/(cos(v) + 2)"
torus.at(0, 0).kind;      // "elliptic"    the outer rim
torus.at(0, "pi").kind;   // "hyperbolic"  the inner rim
torus.area({ u: [0, "2*pi"], v: [0, "2*pi"] });   // an interval around 8π²

The first fundamental form

With r(u,v)r(u, v) the surface and ru,rvr_u, r_v its partial derivatives,

E=ru⋅ru,F=ru⋅rv,G=rv⋅rv. E = r_u \cdot r_u, \qquad F = r_u \cdot r_v, \qquad G = r_v \cdot r_v .

These three functions hold everything that can be measured inside the surface. A curve (u(t),v(t))(u(t), v(t)) on it has speed Eu′2+2Fu′v′+Gv′2\sqrt{E u'^2 + 2F u'v' + G v'^2}; the angle between two directions comes from the same form; and area is

A=∬EG−F2  du dv. A = \iint \sqrt{EG - F^2}\;du\,dv .

The parametrisation is regular where EG−F2>0EG - F^2 > 0. At a point where that fails (the poles of a sphere in latitude and longitude) at refuses.

The second fundamental form and curvature

With unit normal n=(ru×rv)/∣ru×rv∣n = (r_u \times r_v)/|r_u \times r_v|,

L=ruu⋅n,M=ruv⋅n,N=rvv⋅n. L = r_{uu} \cdot n, \qquad M = r_{uv} \cdot n, \qquad N = r_{vv} \cdot n .

Cut the surface with a plane through the normal: the curvature of the section is the normal curvature in that direction. Its largest and smallest values over all directions are the principal curvatures k1≤k2k_1 \le k_2, and

K=k1k2=LN−M2EG−F2,H=k1+k22=EN−2FM+GL2(EG−F2),k1,2=H∓H2−K. K = k_1 k_2 = \frac{LN - M^2}{EG - F^2}, \qquad H = \frac{k_1 + k_2}{2} = \frac{EN - 2FM + GL}{2(EG - F^2)}, \qquad k_{1,2} = H \mp \sqrt{H^2 - K}.

KK is the Gaussian curvature and HH the mean curvature. The sign of HH depends on which way the normal points; KK does not.

kindconditionthe surface near the point
ellipticK>0K > 0lies on one side of its tangent plane, like a dome
hyperbolicK<0K < 0crosses its tangent plane, like a saddle
parabolicK=0K = 0, not planarcurved in one direction only, like a cylinder
planarL=M=N=0L = M = N = 0flat to second order

An enclosure can prove K>0K > 0 or K<0K < 0. It cannot prove K=0K = 0, so parabolic and planar are reported only when the formulas vanish exactly at the point; otherwise kind is null.

The Theorema Egregium

KK is defined through the normal, which is about how the surface sits in space. Gauss found that it can be computed from E,F,GE, F, G alone: bend a sheet of paper without stretching it and KK stays 0 everywhere. intrinsicGaussian() computes KK from the first form by way of the Christoffel symbols and the curvature tensor, and it agrees with gaussian().

Because of that, the curvature makes sense for a metric with no surface behind it; see Geodesics and Gauss-Bonnet.

callreturns
surface(components, [u, v], { params })Surface (a Metric with a normal)
s.first(), s.second(), s.normal(){ E, F, G }, { L, M, N }, r_u × r_v, as formulas
s.gaussian(), s.mean(), s.intrinsicGaussian()formulas
s.at(u, v, { digits = 15 }){ point, normal, E, F, G, L, M, N, gaussian, mean, principal, kind }
s.area(region, { digits = 8 }), s.totalCurvature(region)RationalInterval; region { u: [a, b], v: [lo(u), hi(u)] }
Try itEdit the code and run it with @ratmath/analytic and Core's R, Rational, RationalInterval in scope. The last line's value is shown; PRINT(…) adds lines, TEX(…) typesets math.
Ctrl/⌘ + Enter runs