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
Question 1 Write a note on digitizers Question 2 Discuss on line drawing algorithm Question 3 Explain 3D viewing Question 4 Explain different types of cohe

Problem: a. Explain briefly six Ancillary Operations? b. When do ancillary operations take place? c. (i) What is flexography? (ii) Provide examples of finished produ

For good understanding of the application of the rules specified above see the following figure, where the shaded region demonstrates the clipped polygon. Fi

Question 1) Encode the following string using HUFFMAN ENCODING:                            DO YOU LIKE TINKY WINKY OR EMPTY DUMPTY?     Empty spaces are considered.

Question 1 What is Packet-switching network? Discuss its basic operation Question 2 Briefly describe Jackson's theorem Question 3 List and explain the two popular

do you remember how you to work the computer graphics

Question: (a) Some adverts are set up only with facts and with no use on concepts/emotions. Name and explain two strengths and two weaknesses of "no use of emotions in


To transform from the world coordinate system to viewing coordinate system you need to perform the following operations.  a)  Translate the viewing coordinate origin to the worl

Illumination Model - Polygon rendering and ray tracing methods Theoretically illumination is exposure of a thing to the light that contributes to light reflected by an object