Draw line segment - digital differential analyzer algorithm, Computer Graphics

Assignment Help:

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.


Related Discussions:- Draw line segment - digital differential analyzer algorithm

Define computer graphics, Define Computer graphics.  Computer graphics ...

Define Computer graphics.  Computer graphics remains one of the most popular and rapidly growing computer fields. Computer graphics may be explained as a pictorial representati

Explain briefly ancillary operations, Problem: a. Explain briefly six A...

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

Will the shape of the resulting b-spline curve change, If the spacing betwe...

If the spacing between the knot sequence is uniformly doubled, will the shape of the resulting B-spline curve change?  Justify your answer.

X-shear regarding the origin - 2-d and 3-d transformations, X-shear Regardi...

X-shear Regarding the Origin - 2-d and 3-d transformations Suppose an object point P(x,y) be moved to P'(x',y') in the x-direction, via the given scale parameter 'a',that is,

Multimedia tool features, Multimedia Tool Features General to nearly a...

Multimedia Tool Features General to nearly all multimedia tool platforms are various features for encapsulating the content, presenting the data, acquiring user input and cont

What is transformation, What is Transformation?  Transformation is the ...

What is Transformation?  Transformation is the method of introducing changes in the shape size and orientation of the object using scaling rotation reflection shearing & transl

Implement the boundary fill and flood fill algorithm, 1. Implement the boun...

1. Implement the boundary fill algorithm and flood fill algorithm in C-language and use your code to fill two different types of closed areas such as  i)  A Circle ii)  A sel

Various ways of simulating motion, Various ways of simulating motion:- ...

Various ways of simulating motion:- -        Zero Acceleration (Constant Speed)           -        Non-Zero Accelerations -        Positive accelerations

Phong shading algorithm, Q. Describe briefly phong shading algorithm.   ...

Q. Describe briefly phong shading algorithm.   OR                Write short note on phong shading.    Phong shading   Phong shading or normal vector interpo

Find out the matrix of projection, Find out the matrix of projection for ca...

Find out the matrix of projection for cavalier projection Answer: Cavalier projection corresponds to tan α = 1, leading to the following matrix.

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd