I have a metric: $$g_{\mu\nu}=\begin{bmatrix}-c & 0 & 0 & 0\\0 & a(t) & 0 & 0\\0 & 0 & a(t)\space r & 0\\0 & 0 & 0 & a(t)\space r\space \sinθ\end{bmatrix}$$ Having the dimensions $(t, r, θ, \phi)$. It corresponds to this formula: $$ds^2=i^2c^2dt^2+a(t)^2(dr^2+r^2(dθ^2+ \sin^2θ\space d\phi^2))$$ Could someone show me a real simple example of how I can use the metric (not the formula) to find the distance? I understand reasonably well how to do the problem with just spatial dimensions, but I'm unable to make the leap to 4 dimensions.
I would like to, for example, find the radial distance, $r$, from $a(t)=1$ (present day) to $a(t)=\frac{1}{1091}$ (Epoch of Recombination). I understand how to do this analytically using the formula, but now I want to create a Mathematica program to validate the analytical solution using the metric.