Differential Geometry
Differential geometry uses the techniques of differential and integral calculus to study the geometry of curves and surfaces.
Geometry of Curves
A space curve is defined by a vector function . The key invariants are curvature () and torsion ().
python
1import numpy as np
2
3def calculate_curvature(t_val, dr_dt, d2r_dt2):
4 v1 = dr_dt(t_val)
5 v2 = d2r_dt2(t_val)
6 cross_product = np.cross(v1, v2)
7 norm_v1 = np.linalg.norm(v1)
8 kappa = np.linalg.norm(cross_product) / (norm_v1**3)
9 return kappa
10
11# Helix: r(t) = (cos t, sin t, t)
12dr_dt = lambda t: np.array([-np.sin(t), np.cos(t), 1])
13d2r_dt2 = lambda t: np.array([-np.cos(t), -np.sin(t), 0])
14
15print(f"Curvature of Helix at t=0: {calculate_curvature(0, dr_dt, d2r_dt2):.3f}")
16print("Curvature is constant for a helix.")
Gaussian Curvature
For surfaces, Gaussian Curvature () is the product of the two principal curvatures. It is an intrinsic property, meaning it can be determined by measuring distances along the surface without reference to the surrounding space.
If we bend a flat sheet of paper into a cylinder, does its Gaussian curvature change?
Gauss-Bonnet Theorem
The Gauss-Bonnet Theorem links the total curvature of a surface to its topology (Euler characteristic ):
What is the Euler characteristic of a sphere?
python
1def euler_characteristic(v, e, f):
2 return v - e + f
3
4# Cube: 8 vertices, 12 edges, 6 faces
5print(f"Cube χ: {euler_characteristic(8, 12, 6)}")
6# Tetrahedron: 4 vertices, 6 edges, 4 faces
7print(f"Tetrahedron χ: {euler_characteristic(4, 6, 4)}")