Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Direct
Polar coordinate based
Bresenhams Algorithm
Mid point - Pitteway
y0 202 02 20
y1 202 12 20
y2 202 22 20
Polar coordinates
Polar coordinate equation
x = xc + r cos
y = yc + r sin
(-x,y)
(x,y)
Calculations of
(-y,x)
point coordinates
only for a first
(-y,-x)
one-eighth of a
circle
(y,x)
(y,-x)
(-x,-y)
(x,-y)
Eight-Way Symmetry
The first thing we can notice to make our
circle drawing algorithm more efficient is that
circles centred at (0, 0) have eight-way
(-x, y)
(x, y)
symmetry
(-y, x)
(y, x)
R
2
(-y, -x)
(-x, -y)
(x, -y)
(y, -x)
fcirc ( x, y) x2 y 2 r 2
By evaluating
this function at the midpoint
between the candidate pixels we can make our
decision
or:
pk 1 f circ xk 1 1, yk 1 12
2
1
[(xk 1) 1] yk 1 2 r
2
1 ( r 1 2) 2 r 2
54 r
( x0 , y0 ) (0, r )
p0 5 4 r
pk 1 pk 2xk 1 1
pk 1 pk 2xk 1 1 2 yk 1
4.
5.
6.
x x xc
y y yc
9
8
6
5
3
2
0
0
9 10
pk
(xk+1,yk+1)
2xk+1
2yk+1
k
0
1
2
3
4
5
6
7
8
9
10
11
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
12
pk
(xk+1,yk+1)
2xk+1
2yk+1