Circle Algorithm
Circle Algorithm
Larry F. Hodges
(modified by Amos Johnson)
Larry F. Hodges
(modified by Amos Johnson)
21
of
39
(-x, y)
(-y, x)
(y, x)
(-y, -x)
(y, -x)
(-x, -y)
Larry F. Hodges
(modified by Amos Johnson)
(x, y)
(x, -y)
3
Larry F. Hodges
(modified by Amos Johnson)
23
of
39
(xk, yk)
(xk+1, yk)
(xk+1, yk-1)
of
39
x2
y2
r2
39
fcirc (xk
(x k 1)2
(y
1 )
2
1,
yk
k
1 2 )2
2
If pk < 0 the midpoint is inside
the circle and
the pixel at yk is closer to the circle
Otherwise the midpoint is outside and yk-1
is
closer
Larry F. Hodges
(modified by Amos Johnson)
39
1 )2 2
r
2
1 (r
5
pk
2xk
pk
2xk
1 2 yk 1
8
39
5
4
p0
pk
Larry F. Hodges
(modified by Amos Johnson)
pk
2xk
1
9
29
of
39
pk
pk
2xk
1 2 yk
4.
5.
6.
xc
Larry F. Hodges
(modified by Amos Johnson)
yc
10