If I have
$$ \int\limits_0^T \frac{\sqrt{\dot{x}(t)^2+\dot{y}(t)^2}}{\sqrt{2 y(t)}}dt $$
I can convert this problem of finding the solution to the brachistochrone problem to a geometric problem by looking for a geodesic in the metric:
$$ds^2=\frac{dx^2+dy^2}{y}$$
But how do i come from this equation to the right distance between two points, e.g. given by: enter link description here