implement sphere intersection