Hello all,
on an assignment my professor has asked us to "paint" a few different shapes on a canvas. (square, rectangle, circle, ellipse)
to keep it simple,
I had no problem breezing through the square and rectangle.
to help you understand, here's a bit of code from one of the shapes:
for (leftBoundColumn_c=leftBoundColumn; leftBoundColumn_c <= (leftBoundColumn+bound_Width_Height)-1; leftBoundColumn_c++)
{
for (leftBoundRow_c=leftBoundRow; leftBoundRow_c <= (leftBoundRow +bound_Width_Height)-1; leftBoundRow_c++)
{
bigCanvas.getDot (leftBoundColumn_c, leftBoundRow_c).setRedLevel (amountOfRed);
bigCanvas.getDot (leftBoundColumn_c, leftBoundRow_c).setBlueLevel (amountOfBlue);
bigCanvas.getDot (leftBoundColumn_c, leftBoundRow_c).setGreenLevel (amountOfGreen);
bigCanvas.show();
//bigCanvas.update();
}
}
(leftBoundColumn and leftBoundRow identify the upper left hand point in the shapes, bound_Width_Height is the user's desired height and width of the square. )
I'm having trouble drawing both the ellipse and circle.
i can't conceptually grasp the idea behind using nested for loops to "paint" out these shapes, although this is what my professor demands. (aka no vectors/arrays)
I know (x-a)^2+(y-b)^2=r^2 must fit in there somewhere, but I've no earthly idea where. think someone can point me in the right direction?
thanks ahead of time.
-Jack