A set of algorithms for computing metric distance over manifolds