Wrote the sphere intersection code, but it needs to be tested.