Sei sulla pagina 1di 1

Experiment 1

IMPLEMENTATION OF BRESENHAMS ALGORITHM FOR ELLIPSE

1. Start

2. Read the two end points of the line and assign the left end point to x0 ,y0

3. Load x0 ,y0 into the frame buffer (i.e) plot the first point

4. Compute dx,dy,2dy and 2dy-2dx and determine the decision parameter P0 as 2dy-dx

5. At each xk , along the line starting at k = 0, perform the following test

If Pk < 0, the next point to plot is (xk+1 , yk ) and Pk+1 = Pk +2dy

Otherwise the next point to plot is (xk , yk+1 ) and Pk+1 = Pk +2dy- 2dx

6. Repeat step 4 dx times

7. Stop

Potrebbero piacerti anche