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: a) The implications of transparency are a major influence on the design of system software. There are eight forms of transparency. Name and give a small description o

cathode ray tube is an analog or digital device

Polygon Rendering and Ray Tracing Methods In previous section we had discussed various methods for visible-surface detection, although in order to produce visibility the prese

What is surface patch?  A single surface element can be explained as the surface traced out as two parameters (u, v) take all possible values between 0 and 1 in a two-parameter

Subdivision Algorithm - Visible Surface Detection 1) Initialize the area to be the whole screen. 2) Create a PVPL regarding an area, sorted on z min as the smallest z coor

what is normalization transformation?why is it needed and important?give simple example also.

GRAPHICS: It is one of the core elements of any multimedia application. We all have heard a well-known saying as "one picture conveys a message of 1000 words", hence without


Algorithms for filled-area primitives These algorithms are classified into two categories (i)  Scan line algorithms (ii) Seed fill algorithms.

Question: (a) Explain the importance of knowing and understanding your target market before doing a design work. Use example(s) to enhance your answer. (b) Describe the