You are on page 1of 8

Subject - Computer Graphics (22318)

Unit 2 (Topic 2)

- By Nitin Pawar Sir


U – 2 Raster Scan Graphics
2.1 Basic concepts of Line drawing
2.2 Circle Generating algorithm
2.3 Polygons
2.4 Scan conversion
2.5 Character generation methods
2.2 Circle Generating Algorithms
 What is a circle?
 It is a set of points that are all
at a given distance r from
center position (xc, yc).

 The distance relationship


equation of a circle is
expressed by the Pythagorean
theorem in Cartesian
coordinates as:
( x – xc)2 + ( y – yc)2 = r2
CS 380
2.2....
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 symmetry

(-x, y) (x, y)

(-y, x) (y, x)

R
2
(-y, -x) (y, -x)

(-x, -y) (x, -y)


2.2....
Circle generating algorithms are,
- DDA algorithm
- Bresenham algorithm
- Mid point algorithm

Now we see each algorithm one by one,


2.2.1 DDA Circle generating algorithm steps,

1. Read radius of circle (r) and calculate value of 


(epsilon)
2. x= 0, y=r
3. x1=x, y1=y
4. While((y1-y)<  || (x-x1)>  )
{
x1=x1 +  y1
y1=y1 +  x1
Plot(int(x1),int(y1))
}
5. Stop
2.2.1
Calculation of  (epsilon)
 = 2-n = 1/ 2n
ie. 2n-1<= r <= 2n

eg – r= 50 (radius)
- 25 <= 50<= 26 (ie. n=6)
- (32) (64)
Then,  = 1/26 = 1/64 = 0.0156
Thank
you....

You might also like