I think the first example creates a sphere with the surface normals pointing the wrong way. The definition should be: u = -((X-15)**2 + (Y-15)**2 + (Z-15)**2 - 8**2)