It is important to know that the graphics that we see in a computer screen is not continuous . Instead due to rasterisation of graphics pixels are drawn even if the supposed graph touches or passes through it partially and due to finite size of pixels they might not appear smooth. In order to show the exaggerated effect of finite pixel size and choice of pixels under the considered algorithm, I have assumed that one pixel is of size 1x1 unit. Then I have only illuminated the centre of that square pixel. For a more detailed review of raster drawing technique, I recommend that you go through this link(similar in nature): http://en.wikipedia.org/wiki/Midpoint_circle_algorithm And I formally apologise for not writing a detailed description. Thank you for raising the issue, I hope it would help to better understand the working of this particular code.