Intersection with a sphere
Two questions are important:
- is there an intersection?
- where are the intersection points?
Most rays do not hit a sphere if it is small enough, so a fast “no” to the first question will speed up our calculation.
To answer the second question, we have to solve a quadratic equation. To answer the first, we do not have to.