Implement a function in C to draw a circle using the single point drawing function drawPt(x,y).
Anonimo
Not a hard question, just don't take it at face value. They're looking for efficient elegant code. Remember that you don't have to compute every point in the circle, just 1/8th of the arc and then permutate those coordinates across (+/-x, +/-y) and (+/-y, +/-x). Use Pythagorean's theorem to generate the y coord from the x coord but also remember that the radius doesn't change so precompute it once rather than each time through your loop. I think the bottom line is don't just give them what they ask for at face value, give them the most elegant and efficient code you can think of.