Page 52 - DCAP313_LAB_ON_COMPUTER_GRAPHICS
P. 52
Lab on Computer Graphics
Notes {
p = p + 2 * d y ;
}
else
{
y = y + 1 ;
p = p + 2 * (dy – dx);
}
putpixel(x, y, 10);
}
getch();
closegraph();
}
The line algorithm was developed by Jack E. Bresenham in 1962 at IBM.
Self Assessment Questions
1. ………………. is one of the earliest algorithms developed in the field of computer graphics.
(a) Bresenham line algorithm (b) DDA Line Algorithm
(c) Both of these (d) None of these
2. The DA is not used as the axis of control for the algorithm and is the axis of maximum
movement.
(a) True (b) False
3. In Bresenham’s algorithm using integer arithmetic:
(a) The ε is assumed to be real
(b) Arbitrary real coordinates is assumed to be real
–
(c) ε is assumed to be integer valued
–
(d) Arbitrary real coordinates ε is assumed to be integer valued
4. Bresenham’s algorithm with y as the driving axis:
(a) The points (x 1 , y 1 ) and (x 2 , y 2 ) are assumed not equal and have arbitrary real coordinates
– ε is assumed to be integer valued.
–
(b) The points (x 1 , y 1 ) and (x 2 , y 2 ) are assumed not equal and integer valued. ε is assumed
to be integer valued.
(c) The points (x 1 , y 1 ) and (x 2 , y 2 ) are assumed not equal and have arbitrary real coordinates
is assumed to be real.
(d) The points (x 1 , y 1 ) and (x 2 , y 2 ) are assumed not equal is assumed to be real.
5. For integer Bresenham’s algorithm is the points (x 1 , y 1 ) and (x 2 , y 2 ) are assumed not equal
is assumed to be real.
(a) True (b) False
46 LOVELY PROFESSIONAL UNIVERSITY