Scan Converting a Straight Line A straight line may be defined by two endpoints & an equation. In fig the two endpoints are described by (x 1 ,y 1 ) and (x 2 ,y 2 ). The equation of the line is used to determine the x, y coordinates of all the points that lie between these two endpoints. Using the equation of a straight line, y = mx + b where m = & b = the y interrupt, we can find values of y by incrementing x from x =x 1 , to x = x 2 . By scan-converting these calculated x, y values, we represent the line as a sequence of pixels. Properties of Good Line Drawing Algorithm: 1. Line should appear Straight: We must appropriate the line by choosing addressable points close to it. If we choose well, the line will appear straight, if not, we shall produce crossed lines. The lines must be generated parallel or at 45° to the x and y-axes. Other lines cause a problem: a line segment through it starts and finishes at addressable points, may happen to pass through no an...
excellent work on algorithms
ReplyDelete