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
Persistence (of phosphor) - Display devices Time it takes the emitted light from screen to decay to one-tenth of its original intensity. The point where an electron gun strikes

Rotation about the origin - 2-d and 3-d transformations Specified a 2-D point P(x,y), which we need to rotate, along with respect to the origin O. The vector OP has a length '

Explain Various techniques of Character Generation Algorithm?

Question: (a) Using suitable examples, explain the following basic principles of design: (i) Proximity (ii) Repetition (iii) Contrast (iv) Alignment. (b) Color h

Photo Editing Photo-editing programs are paint programs: it just like they comprise several sophisticated functions for altering images and for scheming aspects of the image,

Define pixel and frame buffer? Pixel is shortened forms of picture element. Every screen point is referred to as pixel or pel.  Picture definition is kept in a memory area c

Advantages of GIF Files GIF is the most extensively supported graphics format upon the Web. GIFs of diagrammatic images appear better than JPEGs. GIF maintains inte

Transformation for Isometric projection - Transformation Suppose that P(x,y,z) be any point in a space.  Assume as a given point P(x,y,z) is projected to the P'(x'y',z') on t

Cohen Sutherland algorithm Point clipping is very simple.  All you need to check is whether a point is inside the window extremes in x- and y-directions.  For line clipping sev

Essential Elements for the Raster Scan Display Three elements are essential for the raster scan display. They are as: 1) The Frame Buffer that is also termed as the Refresh