Draw line segment - digital differential analyzer algorithm, Computer Graphics

1. By using Digital Differential Analyzer algorithm draw line segments from point (1,1) to (9,7).

Ans. We see that the usual equation of the line is specified by:

y = mx+c, here m = (y1 - y0/( x1 - x0)

Specified (x0, y0) → (1, 1) ; (x1, y1) → (9, 7)

⇒ m = (7-1)/(9-1) =6/8

C = y1 - mx1 = 7 - (6/8) *9 = 1/4

Consequently, by equation of line (y = mx + c) we contain: 

 y = (6/8)x+(1/4)

  Digital Differential Analyzer Algorithm Two case:

Case 1:   m < 1   

xi + 1 = xi + 1

 yi + 1 = yi + m

Case 2: m > 1   

xi + 1 = xi + (1/m)

yi + 1 = yi + 1

Here m < 1 so as per to Digital Differential Analyzer algorithm case 1

xi + 1 = xi + 1; yi + 1 = yi + m

Specified (x0, y0) = (1, 1)

1) x1 = x0 + 1 = 2

y1 = y0 + m = 1+ (6/8) = 7/4

Place pixel (x0, round y, colour)

That is, put on (2, 2)

Likewise, go on until (9, 7) is arrived at.

Posted Date: 4/3/2013 2:15:18 AM | Location : United States







Related Discussions:- Draw line segment - digital differential analyzer algorithm, Assignment Help, Ask Question on Draw line segment - digital differential analyzer algorithm, Get Answer, Expert's Help, Draw line segment - digital differential analyzer algorithm Discussions

Write discussion on Draw line segment - digital differential analyzer algorithm
Your posts are moderated
Related Questions
JAS: The JAS file formats were implemented to form the smallest possible picture files for 24bits per pixel image and 8 bit per pixel gray scaled pictures. This uses a discrete co

Question : (a) What do you meant by "solo a layer " in Adobe After Effects. Explain briefly how would you perform it. (b) Briefly explain the importance of an adjustment lay


Properties of Perspective projections - Transformation 1) Faraway objects seem smaller. 2) Straight lines are projected to straight lines. 3) Let line 1 and 2 is two s

Define Affine transformation?  A coordinate transformation of the form X= axxx +axyy+bx, y 'ayxx+ayy y+by  is known as a two-dimensional affine transformation. Every of the tra

Negative Accelerations - computer animation In order to incorporate decreasing speed in an animation the time spacing between the frames must decrease, thus there exists lesser

2D Line Segment Generation  A digitally plotted line is basically an approximation of infinite number of points on an abstract line segment by only a finite number of points on

Define Random Scan/Raster Scan displays. Ans. Random scan is a process in which the display is made by the electronic beam, which is directed, only to the points or division of

The purpose of this assignment is for you to create an animation like you would see on an electronic greeting card. Have fun and be creative.  Here are the requirements: you

Softwares and Hardwares for Computer Animation The categories of both software as well as hardware needed to work on animation are now to be discussed. Computer animation can b