After introducing theInterval class, the intersection code is updated to
if (!ray_t.surrounds(root)) {
root = (h + sqrtd) / a;
if (!ray_t.surrounds(root))
return false;
}
Shouldn't it use contains instead though?
The given code rejects a root that is equal to t_min or t_max.
Well while writing this I went to the book again and saw it rejects such roots before introducing the Interval class too. But again the meaning of t_min or t_max to me is that they are inside the acceptable value boundary. t_min or minimum time sounds like the minimum acceptable value of time.