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
File Formats that are used for Bitmap Data Bitmap data can be saved in a wide variety of file formats are: • BMP: restricted file format that is not appropriate for use in

Objectives of 2-D Viewing and Clipping After going through this section, you should be capable to: 1. Describe the concept of clipping, 2. Observe how line clipping is p


Assignment Task Your task is to review and compare the current cad/cam software systems available with the intention to make a recommendation in the form of a written report f

File format We want an image of a Fly. The wings are incompletely transparent and to present that in our presentation what be problematic if suitable file format is not there.

Progressive Scan: Progressive or non-interlaced scanning is a process which displays, transmits or stores moving images wherein, the lines of all frame are drawn in order. It is i

Explain the advantage and disadvantage of Raster CRT Advantages Allows solids, not just wireframes Leverages low-cost CRT technology (i.e., TVs) Bright, i.e.

Important points for Key Frame Systems - Computer Animation In key frame systems the "in-between" "tweening" or frames can be created from the specification of two or more key

The table as given below demonstrates possible values of such parameters for classic applications of digital video. Application                  Frame rate                  Dime

Q.  Write a short note on area subdivision method for hidden surface removal.   Ans. Area Subdivision This technique for hidden- surface removal is essentially an image- spac