One Last Trick
Can we eliminate that sqrt( ) call from the inner loop?
- Notice we only computes values of y where the local slope is less than 1.
- At every step in x we either leave y at its current value or change it by 1.
First, lets revisit the equation of a circle centered at the origin:
This expression will take on the following values:
We call this function, f(x, y), a discriminator.
|