## Manifolds and Riemannian metrics
A smooth manifold M is a space covered by charts with smooth transition maps. A Riemannian metric g is a smooth choice of inner product g_p on each tangent space T_pM; in a chart g = g_ij dxⁱ dxʲ. The metric gives lengths L = ∫ √(g(γ′, γ′)) dt, angles and areas dA = √det g dx dy.
## Displayed quantities
| Quantity | Formula | Meaning |
| **g_ij** | E, F, G | The metric at the point |
| **det g, √det g** | EG − F² | √det g is the area element dA = √det g dx dy |
| **g^ij** | (1/det g)·[[G, −F], [−F, E]] | Inverse metric (used to raise indices) |
| **Γᵏᵢⱼ** (Christoffel symbols) | ½ gᵏˡ (∂ᵢgⱼₗ + ∂ⱼgᵢₗ − ∂ₗgᵢⱼ) | Coefficients of the Levi-Civita connection (the unique torsion-free connection preserving g) |
| **K** (Gaussian curvature) | Brioschi's formula from E, F, G and their derivatives | In dimension 2 the whole curvature tensor is determined by K |
| **Ric, R** | Ric = K·g, R = 2K | Ricci tensor and scalar curvature of a surface |
| **R₁₂₁₂** | K·det g | The only independent component of the Riemann tensor in dimension 2 |
| **Geodesic** | ẍᵏ + Γᵏᵢⱼ ẋⁱ ẋʲ = 0 | Locally shortest curves; ∇_γ′γ′ = 0 |
The Levi-Civita connection is defined by ∇_X Y with Γᵏᵢⱼ as above, and the Riemann tensor by R(X, Y)Z = ∇_X∇_Y Z − ∇_Y∇_X Z − ∇_[X,Y] Z. In dimension 2 the sectional curvature is the single number K.
## Examples and expected results
| Example | E, F, G | K |
| Euclidean plane | 1, 0, 1 | 0 |
| Sphere (θ, φ) | 1, 0, sin²x | 1 |
| Poincaré half-plane | 1/y², 0, 1/y² | −1 |
| Poincaré disk | 4/(1−x²−y²)², 0, 4/(1−x²−y²)² | −1 |
| Polar coordinates (r, θ) | 1, 0, x² | 0 (flat plane in polar coordinates) |
| Hyperbolic cylinder | 1, 0, e^(2x) | −1 |
| Paraboloid z = x² + y² (induced) | 1+4x², 4xy, 1+4y² | 4/(1+4x²+4y²)², so 4 at the origin |
In the Poincaré half-plane the geodesics are vertical lines and semicircles centred on the x axis. Starting at (0, 1) with angle 0°, the geodesic follows the unit circle x² + y² = 1. In the Poincaré disk they are arcs of circles orthogonal to the unit circle. Flat polar coordinates show that the same flat metric can look very different in another chart; K stays 0.
## Points table
The table icon opens a separate screen (`PointsActivity`) with E, F, G and K on a grid of (x, y) values. Set **x from / to / step** and **y from / to / step**, then tap **Compute**; the defaults split the current ranges into 4 steps (a 5 × 5 grid). Up to 2000 points are shown. The text is selectable, so it can be copied.
## Saving metrics
- **Save (disk icon):** stores the current metric and chart ranges under a name; saving with an existing name overwrites it.
- **My metrics (folder icon):** lists saved metrics. Tap one to load and draw it; long-press to delete.
- Metrics 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`.
## How it works
E, F, G are evaluated from your expressions; their first derivatives use central differences (step 10⁻⁴), second derivatives (E_yy, G_xx, F_xy for Brioschi's formula) use step 10⁻³. Geodesics are integrated with the classical Runge-Kutta (RK4) method in 200 steps; the error indicator |g(γ′, γ′) − 1| shows how well the unit speed is preserved.
## Limitations
- Numerical derivatives give about 4-5 correct digits.
- The metric must be positive definite (E > 0 and EG − F² > 0); otherwise the app reports that at the point. Singular points (for example y = 0 in the half-plane) are outside the valid chart.
- Only dimension 2 is supported, so the Riemann tensor reduces to the single curvature K.