## Points table
The table icon opens a separate screen (`PointsActivity`) with the coordinates x, y, z of points of the surface on a grid of (u, v) values. Set **u from / to / step** and **v from / to / step**, then tap **Compute**; the defaults are the current ranges split into 4 steps (a 5 × 5 grid). Up to 2000 points are shown. The text is selectable, so it can be copied.
## Saving surfaces
- **Save (disk icon):** stores the current surface (x, y, z and the ranges) under a name; saving with an existing name overwrites it.
- **My surfaces (folder icon):** lists saved surfaces. Tap one to load and draw it; long-press to delete.
- Surfaces are kept on the device (SharedPreferences) and survive app restarts.
## Languages
All screens (main screen, points table, dialogs, menus) are available in English (default), Bulgarian, French, German and Spanish. By default the app follows the phone language; **Language** in the top bar switches it manually (the choice is remembered). To add a language, copy `res/values/strings.xml` to `res/values-XX/`, translate the values, then add the code to `LANG_CODES` and a menu item in `main_menu.xml` / `MainActivity.java`.
## Displayed quantities
| Quantity | Formula | Meaning |
| **r_u, r_v** | ∂r/∂u, ∂r/∂v | Tangent vectors to the coordinate lines |
| **n** | (r_u × r_v) / \|r_u × r_v\| | Unit normal (its sign depends on the parametrization) |
| **E, F, G** | r_u·r_u, r_u·r_v, r_v·r_v | First fundamental form I = E du² + 2F du dv + G dv²: lengths and angles on the surface |
| **L, M, N** | r_uu·n, r_uv·n, r_vv·n | Second fundamental form II = L du² + 2M du dv + N dv²: how the surface bends in space |
| **√(EG−F²)** | \|r_u × r_v\| | Area element: dA = √(EG−F²) du dv |
| **K** (Gaussian curvature) | (LN − M²) / (EG − F²) | Intrinsic curvature (Theorema Egregium: depends only on I). Sphere of radius R: 1/R² |
| **H** (mean curvature) | (EN − 2FM + GL) / (2(EG − F²)) | Average of the principal curvatures. Sign depends on the choice of n |
| **k₁, k₂** (principal curvatures) | H ± √(H² − K) | Extreme normal curvatures at the point; K = k₁·k₂, H = (k₁ + k₂)/2 |
| **Point type** | sign of K | elliptic (K > 0), hyperbolic (K < 0), parabolic (K = 0, H ≠ 0), planar (K = H = 0), singular (r_u × r_v = 0) |
| **Area** | ∬ √(EG−F²) du dv | Area of the patch over the whole rectangle (Simpson's rule, 20 × 20) |
## Examples and expected results
| Surface | K | \|H\| | Type |
| Sphere of radius 1 | 1 | 1 | elliptic |
| Cylinder of radius 1 | 0 | 0.5 | parabolic |
| Paraboloid z = u² + v² at (0, 0) | 4 | 2 | elliptic |
| Saddle z = u² − v² at (0, 0) | −4 | 0 | hyperbolic |
| Helicoid | < 0 everywhere | 0 (minimal surface) | hyperbolic |
| Torus (R = 2, r = 1) | positive outside, negative inside | varies | mixed |
At the middle of the sliders the paraboloid and saddle examples are at (0, 0).
## Geodesics
A geodesic is a "straightest possible" curve on the surface: its acceleration is normal to the surface (geodesic curvature κ_g = 0), and locally it is the shortest path between two points. With γ(s) = (u(s), v(s)) and the Christoffel symbols Γᵏᵢⱼ (computed from E, F, G and their first derivatives):
- u″ + Γ¹₁₁u′² + 2Γ¹₁₂u′v′ + Γ¹₂₂v′² = 0
- v″ + Γ²₁₁u′² + 2Γ²₁₂u′v′ + Γ²₂₂v′² = 0
**How to use:** move the u and v sliders to the start point, enter the **angle** in degrees (measured from r_u towards r_v) and the **length** s (arc length along the surface), then tap **Geodesic**. The geodesic is drawn in orange and the info panel shows the end point (u, v) and r, the length of the polyline in space, the straight-line distance start–end, and the error indicator |I(γ′,γ′) − 1| (the speed should stay 1). After moving the sliders, tap the button again to start from the new point. **Draw** clears the geodesic.
**Method:** the ODE system is integrated with the classical Runge-Kutta (RK4) method in 200 steps; the metric derivatives are numerical. Integration stops early near singular points (r_u × r_v = 0).
**Checks:** on the unit sphere (example "Sphere") geodesics are great circles; with length π the straight-line distance start–end is about 2 (antipodal points). On the cylinder (example "Cylinder") geodesics are helices; at angle 0° or 90° they are a circle or a straight line. On the plane (z = 0) they are straight lines.
## Theorema Egregium
Gauss's Theorema Egregium says that the Gaussian curvature K is **intrinsic**: it is determined by the first fundamental form (E, F, G) and its derivatives alone, even though K = k₁·k₂ is defined through the extrinsic principal curvatures. The app demonstrates this by computing K two ways for the selected point:
1. from the second fundamental form: K = (LN − M²) / (EG − F²)
2. from E, F, G only, with **Brioschi's formula** K = (det A − det B) / (EG − F²)², where
A = [[−E_vv/2 + F_uv − G_uu/2, E_u/2, F_u − E_v/2], [F_v − G_u/2, E, F], [G_v/2, F, G]]
B = [[0, E_v/2, G_u/2], [E_v/2, E, F], [G_u/2, F, G]]
The info panel shows both values and their absolute difference, which should be close to 0 (about 10⁻³ to 10⁻⁵, limited by the numerical derivatives of E, F, G). The ⋮ menu has an explanation dialog.
Consequences: a sphere (K > 0) cannot be flattened onto a plane (K = 0) without distortion, which is why every flat map is distorted; a cylinder and a cone (K = 0) are locally isometric to the plane; a catenoid and a helicoid are locally isometric.
## How it works
r_u and r_v use central differences (step 10⁻⁴); r_uu, r_uv and r_vv use second-order central differences (step 10⁻³). The formulas above are then applied.
## Limitations
- Numerical derivatives give about 4-5 correct digits; very steep surfaces lose accuracy.
- At singular points (r_u × r_v = 0, for example the poles of a sphere parametrized by angles) the normal and curvatures are undefined and shown as "—".
- The sign of n, and therefore of H, L, M, N, depends on the order of u and v.