Static Sphere vs Sphere

To detect whether two spheres are intersecting, you can simply calculate the distance
of the sphere’s centers and if this is less than the combined radii of the spheres,
the spheres are intersecting each other.

Normally, to calculate the distance between two points, the square root has to be
taken. A small optimization you can apply is to instead square the radii as it
involves a simple multiplication that can be computed much faster than the square
root. The following C# code snippet demonstrates how this test can be implemented: