Geodesics Simulation

This app computes the geodesic from the given initial conditions on a parametric surface.

The surface is given by the Cartesian coordinates \(\vb*{r} = (x, y, z)\) dependent on the parameters \(u, v\) which are used as the coordinates.

The trig functions \(\sin, \cos, \tan\), their hyperbolic counter parts and their inverses are available. Use ^ or ** to raise to a power and sqrt for square root. Parameters and variables are prefixed by the percent symbol (e.g. %u). Only one letter variables are allowed. %pi and %e are reserved.

Tangent Basis & Metric Tensor

Given the parametric equation for a surface, we can compute the tangent basis vectors by taking the partial derivatives of the position vector:\begin{align*} \vb*{e_u} &= \pdv{\vb*{r}}{u}, \\ \vb*{e_v} &= \pdv{\vb*{r}}{v}. \end{align*}

The metric tensor is the dot product of the tangent basis vectors:\[g_{ij} = \vb*{e_i} \vdot \vb*{e_j},\]together with the inverse metric \(g^{ij}\) satisfying:\[g_{ij} g^{jk} = \delta_i{}^k,\]where the Einstein summation convention is used.

Christoffel Symbols & Geodesics

The Christoffel symbols of the second kind are given by the following combination of partial derivatives of the metric tensor:\[ \Gamma^i{}_{kl} = \frac{1}{2} g^{im} \pqty{g_{mk,l} + g_{ml,k} - g_{kl,m}}, \]where comma denotes partial derivative with respect to a coordinate.

The shortest path between two points parametrized by \(\lambda\) satisfies the geodesic equation:\[ \dv[2]{x^i}{\lambda} + \Gamma^i{}_{jk} \dv{x^j}{\lambda} \dv{x^k}{\lambda} = 0. \]

Solution

The Christoffel symbols are computed at every point of the path. For partial derivatives, a finite difference is used for approximation:\[ f'(x) \approx \frac{f(x + h) - f(x)}{h}. \]

The geodesic equation is a system of two ODEs - one for each coordinate. We will use the Euler method or RK4 for numerical solution, depending on the choice of the user.

Controls

Use the left mouse button to rotate the camera and the right mouse button to pan around. Use the scroll wheel to zoom.

Surface

Presets

Path

Cosmetic