in reply to Square Root algorithm

I've done this, really. In days long past, I was doing Lambert Shading on a 16-bit machine with integer arithmetic. In assembly language, I coded a square root using Newton's Method. You use a simple average; Newton uses the slope (based on the derivitive function) to project to the next guess very accuratly.

The interesting thing is that in my shading, iterating over a row of pixels, the result is probably very close to the result of the previous pixel, since the whole point of this is "smooth shading", right? So I used the previous call as the initial guess, and most often got the right answer after one iteration.

—John

Replies are listed 'Best First'.