public static boolean testSphereSphere(
            double aX, double aY, double aZ, double radiusSquaredA,
            double bX, double bY, double bZ, double radiusSquaredB) {
        double dX = bX - aX, dY = bY - aY, dZ = bZ - aZ;
        double distSquared = dX * dX + dY * dY + dZ * dZ;
        double h = 0.5 + (radiusSquaredA - radiusSquaredB) / distSquared;
        double r_i = radiusSquaredA - h * h * distSquared;
        return r_i >= 0.0;
    }
public static boolean testSphereSphere ( double aX , double aY , double aZ , double radiusSquaredA , double bX , double bY , double bZ , double radiusSquaredB ) { double dX = bX - aX , dY = bY - aY , dZ = bZ - aZ ; double distSquared = dX * dX + dY * dY + dZ * dZ ; double h = 0.5 + ( radiusSquaredA - radiusSquaredB ) / distSquared ; double r_i = radiusSquaredA - h * h * distSquared ; return r_i >= 0.0 ; }
Test whether the one sphere with center <code>(aX, aY, aZ)</code> and square radius <code>radiusSquaredA</code> intersects the other
sphere with center <code>(bX, bY, bZ)</code> and square radius <code>radiusSquaredB</code>.
<p>
Reference: <a href="http://gamedev.stackexchange.com/questions/75756/sphere-sphere-intersection-and-circle-sphere-intersection">http://gamedev.stackexchange.com</a>

@param aX
the x coordinate of the first sphere's center
@param aY
the y coordinate of the first sphere's center
@param aZ
the z coordinate of the first sphere's center
@param radiusSquaredA
the square of the first sphere's radius
@param bX
the x coordinate of the second sphere's center
@param bY
the y coordinate of the second sphere's center
@param bZ
the z coordinate of the second sphere's center
@param radiusSquaredB
the square of the second sphere's radius
@return <code>true</code> iff both spheres intersect; <code>false</code> otherwise