Distance from a sphere to a disjoint surface (source code)

= Distance from a sphere to a disjoint surface
{title2=$\operatorname{dist}(rS^{n-1},M)=\inf_{x\in M}\|x\|-r$}

If a <surface> lies outside a sphere centered at the origin, its <minimum distance> to the sphere is its minimum radial distance minus the sphere radius. For each <surface> point, the <triangle inequality> gives that <lower bound>, and the radial point on the sphere attains it. Thus minimizing the squared <norm> on the <surface> suffices.