MaximumDistance function

The "Maximum" distance