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 , , and its inverse as . The Christoffel symbols
say how the coordinate directions turn from point to point. christoffel() lists the six different ones under keys such as u_uv for .
Geodesics
A geodesic is a curve that does not turn within the surface: its acceleration has no tangential part. In coordinates,
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 along a curve without turning it within the surface means solving
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 over the region enclosed. Around the circle of colatitude on the unit sphere that is , 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 : how much someone walking on the surface has to steer. For ,
It is zero exactly along geodesics. The sign is positive when the curve turns towards the side to which rotates into .
The Gauss-Bonnet theorem
For a region on a surface bounded by a simple closed curve made of smooth pieces,
where the 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 : more than on a sphere, less on a saddle.
gaussBonnet(region) checks the theorem on the image of the region . 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 . 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.
| call | returns |
|---|---|
| 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 |
@ratmath/analytic and Core's R, Rational, RationalInterval in scope. The last line's value is shown; PRINT(…) adds lines, TEX(…) typesets math.