Update SphereAlgorithm

Improved variable names.
Fix consistency (sqrt vs ** 0.5).
Update docstring.
Improved indentation for clarity.