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

Consider shiny surface with diffused reflection coefficient, Consider a Shi...

Consider a Shiny Surface Along With Diffused Reflection coefficient Consider a shiny surface along with diffused reflection coefficient of 0.8 and ambient reflection coeffici

Steps involved in performing image based processing, QUESTION (a) Expla...

QUESTION (a) Explain the steps involved in performing Image based processing. (b) Propose a mask using a 3X3 matrix, which would help in discovering discontinuities, and hen

What is bitmap and what is pixmap, What is bitmap and what is pixmap?  ...

What is bitmap and what is pixmap?  The frame buffer used in the black and white system is called as bitmap which take one bit per pixel. For systems with many bits per pixel,

Advantages of bresenham’s line drawing algorithm, What are the advantages o...

What are the advantages of Bresenham's line drawing algorithm over DDA line drawing algorithm? DDA and Bresenham algorithms both are efficient line drawing algorithm. Breaenham

What is the purpose of saving selections, Question 1: (a) Once a select...

Question 1: (a) Once a selection is made, what area of the image can be edited? (b) What is the purpose of saving selections? (c) How can you move a selection while you a

Arguments made in favor of digital sound, Arguments made in favor of Digita...

Arguments made in favor of Digital Sound Dynamic range. Lower noise floor. Immunity to wow and flutter. Absence of generation loss. Capability to apply redu

Photoshop, What is the best selection method in photoshop

What is the best selection method in photoshop

Drawing, how can I draw a flower.

how can I draw a flower.

Number system, Perform the indicated base conversions 548 to base 5

Perform the indicated base conversions 548 to base 5

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