Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

OK, I got what you're saying now, thanks! I got my wires crossed; I thought Newton's method was something else, but I was actually already implementing that.

I think it's a clever idea to use the native square root to seed the guess. That hadn't occurred to me. In my solution, I do integer square roots, and the fixed just dispatches to that, so I could drastically improve my guess if I used the native square root there. Nice idea!

I use pi just for normalization of the light power: https://github.com/aquach/from-nand-to-raytracer/blob/main/r...

And I don't use trig. I mention it just for fun. In the original Rust raytracer tutorial, they use trig to set up the field of view, but I hardcoded it to 90 degrees to remove the trig.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: