Hey guys,
I have an assignment for a programming class and it is basically to draw a circle inside of a rectangle of user specified dimensions. The radius of the circle is to be half of the smallest dimension(width or height). The picture has to be a PPM image. I know there are much easier ways to accomplish this but we are required to write a loop that prints every pixel individually.
I've got the basic idea but I just can figure out the parameters to use to determine when I print one color(the circle) versus printing another color( the rectangle surrounding the circle). From what I've been able to find is that the formula x^2 * y^2 = r^2 can be of some help but everything I have tried doesn't work. Any ideas would be greatly appreciated.
THanks!