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

Demerit - phong shading or normal vector interpolation shading Needs lot of computations to determine intensity at a point, hence increases the cost of shading in any impleme

What is the difference between odd-even rule and non-zero winding number rule to identify interior regions of an object? Develop an algorithm for a recursive method for filling a 4

Area subdivision Method - Visible Surface Detection What are the circumstances to be fulfilled, in Area-subdivision method, thus a surface not to be divided in addition? S

Bezier Curves and Surfaces We had discussed in the previously that we can create complicated geometries along with the aid of polygon meshes that are further constituted of s

Polygon Filling Algorithm - Raster Graphics and Clipping In several graphics displays, this becomes essential to differentiate between different regions by filling them along

What is the advantages of electrostatic plotters? Advantages of electrostatic plotters: They have very high quality printers and faster than pen plotters. Recent electros

Interlaced GIF: The conventional which is non-interlaced GIF graphic downloads one line of pixels at one time from top to bottom and browsers display all lines of the image as it

1. How does the resolution of a system influence graphic display? Ans. In a high resolution system the adjacent pixels are so near spaced such approximated line-pixels lie extr

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