You are on page 1of 9

Circle Drawing

• Radius .
• Circle coordinates.
Circle drawing algorithms:
1- Midpoint

2- Bresenham’s
Midpoint For a circle centered at origin
algorithm with radius= r , X =0, Y =r
P=5/4-r

While X > Y ‫يتوقف عندما ال‬


‫يتحقق هذا الشرط‬
NO YES
IF
p<0

X=x+1
X=x+1
Y=y-1
Plot(x,y)
Plot(x,y)
P=p+2x+1
P=p+2x+1-2y
Bresenham’s For a circle centered at origin
algorithm with radius= r , X =0, Y =r
P=3-2r

While X > Y ‫يتوقف عندما ال‬


‫يتحقق هذا الشرط‬
NO YES
IF
p<0

X=x+1
X=x+1
Y=y-1
Plot(x,y)
Plot(x,y)
P=p+4x+6
P=p+4(x-y)+10
Question1: given a circle centered at origin and
radius=13, what position should be generated
using midpoint algorithm?

Question2: given a circle with center (-1,2) and


radius=10, what position should be generated
using bresenham’s algorithm?
Circle symmetry
(-x,y) (x,y)

3 2

(-y,x) 4 1 (y,x)

(-y,-x) (y,-x)
5 8
6 7

(-x,-y) (x,-y)
• In circle drawing, the equivalent y-coordinate
of output point (-17,1) in the 3d octant is:
• 1) 1
• 2) 17
• 3) -1
• 4) -17
• In Bresenham’s algorithm, while generating a circle, it is easy to generate?
• 1) one octant first and other by successive reflection
• 2) one octant first and other by successive rotation
• 3)one octant first and other by successive translation
• 4) all octant
• Plot 6 points of circle using bresenham’s
algorithm. When radius of circle is 10. the
circle has center(50,50)?

You might also like