This is based on the distance formula in three-dimensional space, since you can define a sphere as every point within a certain distance of the center point.
The distance between any two objects is equal to the square root of (x1-x2)^2 + (y1-y2)^2 + (z1-z2)^2.
The above function is flagging each voxel if they are within 20 units of the origin. Since the origin is (0, 0, 0), the distance function simplifies down to square root of x1^2 + y1^2 + z1^2. This also throws in another optimization by getting rid of the square root, and comparing the result to 20^2.