Circle Mid Point
Circle Mid Point
Circle Mid Point
y r x2 2
A Simple Circle Drawing Algorithm
(cont…)
y0 20 2 0 2 20
y1 20 2 12 20
y2 20 2 2 2 20
y19 20 2 19 2 6
y20 20 2 20 2 0
A Simple Circle Drawing Algorithm
For x = – R to R
y = sqrt(R * R – x * x);
Pixel (round(x), round(y));
(17, 0)
Pixel (round(x), round(-y));
(0, 17)
1 2 3 4
Mid-Point Circle Algorithm
6
M
5
1 2 3 4
Mid-Point Circle Algorithm
6
M
5
1 2 3 4
Circle drawing.
• Can also use Bresenham to draw circles.
M
SE
12
Mid-Point Circle Algorithm
• Let’s the equation of the circle slightly to give us:
x, y ) x as
f circ (evaluates
• The equation yfollows:
2
r
2 2
d k 1 f circ x p 1 1, y p 1 1 2
2
• or: 2
[( x p 1) 1] y p 1 1
2
r2
0 1 2 3 4 5 6 7 8 9 10 1112 13141516 12