if (thit == t[1] || t[1] > ray.maxt)
return result;
thit = t[1];
// compute sphere hit position and phi
phit = ray.eval(thit);
if (phit.x == 0.0 && phit.y == 0.0)
phit.x = 1e-5 * radius;
phi = Math.atan2(phit.y, phit.x);
if (phi < 0.0)
phi += 2 * Math.PI;