raytracing.github.io icon indicating copy to clipboard operation
raytracing.github.io copied to clipboard

math error in sphere.h?

Open yxsamurai opened this issue 8 years ago • 1 comments

on line 33 in sphere.h a little misleading perhaps... if (discriminant > 0) -> if (discriminant >= 0) may be better?

yxsamurai avatar Sep 09 '18 13:09 yxsamurai

Maybe! I think 0 is the grazing case and that is where the cosine with the normal will be 0 or even a little negative. So I usually go with >. But this is not a strongly held optinion

Pete

On Sun, Sep 9, 2018 at 7:06 AM CrzDog [email protected] wrote:

on line 33 in sphere.h a little misleading perhaps... if (discriminant > 0) -> if (discriminant >= 0) may be better?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/petershirley/raytracinginoneweekend/issues/13, or mute the thread https://github.com/notifications/unsubscribe-auth/ACq6iiFH-sZudbYlDkr9i2KBN-fUKfrwks5uZRJTgaJpZM4WgRvU .

petershirley avatar Sep 09 '18 13:09 petershirley