Consider a manifold $M\subset\mathbb{R}^N$, and let $x,y\in M$ be on its boundary.
I want to compute the geodesic distance between $x$ and $y$ along $M$.
For which manifolds $M$ can we actually perform this computation? How are these computations performed (references are preferable)? I am interested in both closed-forms of the geodesic distance and geodesic distances which can be "reasonably estimated in a quick amount of time," whatever that means to you.
I imagine this is probably possible for any affine manifolds and the sphere. However I'm not sure how to compute the geodesic distance even for the sphere. Is this possible on, e.g., a torus? What about polyhedra?
EDIT: @DavidK's comment answers it for the sphere.