0% found this document useful (0 votes)
52 views

Midpoint Circle Drawing Algorithm

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
52 views

Midpoint Circle Drawing Algorithm

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

Circle Generation

Algorithms
Circle Generation Algorithms
 The equation of a circle:

We could solve for y in terms of x


Circle Generation Algorithms

 The spacing between plotted pixel


positions is not uniform.
Circle Generation Algorithms
 Computation can be reduced by
considering the symmetry of circles

8 -Way symmetry
Midpoint Circle
Algorithm
Circle Generation Algorithms
 As in the line algorithm, we sample at
unit intervals and determine the closet
pixel position to the circle path at each
step.
Circle Generation Algorithms
 Points are generated from 90º to 45º, moves
will be made only in the +x and –y
direction.
 positive x direction over this octant and use
a decision parameter
Circle Generation Algorithms
 We define a circle function:
< 0

f circle
( x, y ) = x + y − r  = 0
2 2 2

> o

Circle Generation Algorithms
Midpoint 1

( x + 1, y − )
i i
2
 Consider the coordinates of the point
halfway between pixel T and pixel S

Midpoint
Circle Generation Algorithms

 We use it to define a decision


parameter
1 1
p = f ( x + 1, y − ) = ( x +1) + ( y − ) − r
i i i
2
i
2 2

2 2
Circle Generation Algorithms
 If pi < 0 is negative, the midpoint
is inside the pixel, and we choose
pixel T.
 If pi ≥ 0 we choose pixel S.
Circle Generation Algorithms
 Parameter for the next step is:
1
p = ( x + 1) + ( y − ) − r
i +1 i +1
2
i +1
2

2
 since
x = x +1
i +1 i
Circle Generation Algorithms
 If T is chosen ( pi < 0 ) we have:

 If pixel S is chosen ( pi ≥ 0 ) we
have
Circle Generation Algorithms

In terms of
Circle Generation Algorithms
Initial value for the decision parameter using the
original function of (0,r)

When r is an integer we can simply set


Circle Generation Algorithms

You might also like