Topic

Geodesics and Gauss-Bonnet

The geometry inside a surface needs only its first fundamental form. A metric is that form on its own; a surface is a metric too. Both give Christoffel symbols, geodesics as validated solutions of their differential equations, parallel transport, geodesic curvature, and the Gauss-Bonnet theorem as a checked statement.

const sphere = surface(["cos(u)*sin(v)", "sin(u)*sin(v)", "cos(v)"], ["u", "v"]);
sphere.christoffel();     // { u_uv: "cos(v)/sin(v)", v_uu: "-(sin(v)*cos(v))", ... }

const plane = metric({ E: "1/v^2", F: 0, G: "1/v^2" }, ["u", "v"]);   // the hyperbolic half-plane
plane.gaussian();         // "-1"

const g = plane.geodesic({ from: [0, 1], direction: [1, 0], until: 1 });
g.quick.value;            // a preview at once: { t, y: [u, v, u', v'] }
g.exact().final;          // certified enclosures of u, v, u', v' at the end

sphere.gaussBonnet({ u: [0, 1], v: [1, 2] }).agree;   // true

Christoffel symbols

Write the metric as g11=Eg_{11} = E, g12=g21=Fg_{12} = g_{21} = F, g22=Gg_{22} = G and its inverse as gklg^{kl}. The Christoffel symbols

Γijk=12∑lgkl(∂iglj+∂jgli−∂lgij) \Gamma^k_{ij} = \tfrac12 \sum_l g^{kl}\bigl(\partial_i g_{lj} + \partial_j g_{li} - \partial_l g_{ij}\bigr)

say how the coordinate directions turn from point to point. christoffel() lists the six different ones under keys such as u_uv for Γuvu\Gamma^u_{uv}.

Geodesics

A geodesic is a curve that does not turn within the surface: its acceleration has no tangential part. In coordinates,

u′′=−∑i,jΓiju xi′xj′,v′′=−∑i,jΓijv xi′xj′,(x1,x2)=(u,v). u'' = -\sum_{i,j} \Gamma^u_{ij}\,x^{i\prime} x^{j\prime}, \qquad v'' = -\sum_{i,j} \Gamma^v_{ij}\,x^{i\prime} x^{j\prime}, \qquad (x^1, x^2) = (u, v).

Geodesics are the straight lines of the surface: great circles on a sphere, and in the half-plane model vertical lines and half-circles centred on the boundary. A short enough piece of a geodesic is the shortest path between its ends.

geodesic solves this system from a point in a direction. Like every differential equation here it answers twice: quick is a floating-point preview, and exact() is a validated solution whose every value is an enclosure. Certified steps of this system take about a second each, so the defaults are modest (six digits); pass order and tol for more. With { unit: true } the direction is scaled to unit speed, and the parameter is arc length.

Parallel transport

Carrying a tangent vector VV along a curve c(t)c(t) without turning it within the surface means solving

Vk′=−∑i,jΓijk ci′ Vj. V^{k\prime} = -\sum_{i,j} \Gamma^k_{ij}\,c^{i\prime}\,V^j .

Transport keeps lengths and angles. Carried around a closed curve a vector comes back rotated, and on a surface the rotation equals the integral of KK over the region enclosed. Around the circle of colatitude φ\varphi on the unit sphere that is 2π(1−cos⁡φ)2\pi(1 - \cos\varphi), which is why a Foucault pendulum away from the poles does not return to its plane in a day. transport reports the transported vector and the angle.

Geodesic curvature

The curvature of a curve on a surface splits into a part along the normal and a part within the surface. The second is the geodesic curvature kgk_g: how much someone walking on the surface has to steer. For c(t)=(u(t),v(t))c(t) = (u(t), v(t)),

kg=EG−F2 (u′Av−v′Au)∣c′∣3,Ak=xk′′+∑i,jΓijk xi′xj′. k_g = \frac{\sqrt{EG - F^2}\,\bigl(u'A^v - v'A^u\bigr)}{|c'|^3}, \qquad A^k = x^{k\prime\prime} + \sum_{i,j}\Gamma^k_{ij}\,x^{i\prime}x^{j\prime}.

It is zero exactly along geodesics. The sign is positive when the curve turns towards the side to which uu rotates into vv.

The Gauss-Bonnet theorem

For a region RR on a surface bounded by a simple closed curve made of smooth pieces,

∬RK dA  +  ∮∂Rkg ds  +  ∑iθi  =  2π, \iint_R K\,dA \;+\; \oint_{\partial R} k_g\,ds \;+\; \sum_i \theta_i \;=\; 2\pi,

where the θi\theta_i are the exterior angles at the corners. For a triangle with geodesic sides the middle term vanishes and the theorem says that the angles add to π+∬K dA\pi + \iint K\,dA: more than π\pi on a sphere, less on a saddle.

gaussBonnet(region) checks the theorem on the image of the region {a≤u≤b, lo(u)≤v≤hi(u)}\{a \le u \le b,\ lo(u) \le v \le hi(u)\}. The three terms are enclosed separately: a double integral, one integral per side, and an angle per corner measured with the metric. It reports each, their sum, and whether the sum contains 2π2\pi. The theorem holds, so agree is a check of the computation and a way to see how the three terms trade off as the region changes. The patch must be regular up to its boundary.

callreturns
metric({ E, F, G }, [u, v], { params })Metric
m.christoffel(), m.gaussian()formulas
m.geodesic({ from, direction, until, unit, order, tol })a Refinement: quick, exact() an ODESolution in (u, v, u′, v′)
m.transport(path, [a, b], vector, { order, tol }){ start, vector, length, lengthAfter, angle, solution }; path { u: "…", v: "…" } in t
m.geodesicCurvature(path, t)a formula, or with t a RationalInterval
m.gaussBonnet(region, { digits = 7 }){ statement, curvature, boundary, angles, total, expected, agree }
m.area(region), m.totalCurvature(region)RationalInterval
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