If l want to draw a circle.How to do it?,
Crossbones+ - Reputation: 3977
Posted 31 October 2012 - 02:56 AM
Search for "Bresenham circle" for a discrete approach; alternatively, you can tessellate (or subdivide) your circle into line segments that approximate the circle and draw those with a line algorithm.
Members - Reputation: 5224
Posted 01 November 2012 - 01:58 PM
x = radius * cos(theta);
y = radius * sin(theta);
Where, theta is all values between 0 and 2PI, and radius is greater than zero.
So, to draw a circle, you can could either plot a bunch of pixels to the screen at the X,Y coordinates as you loop through every value of theta...
or you could draw line segments between each of the X/Y value pairs for all values of theta.