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
Illustrate the Advantages of using virtual reality - it's safer (As techniques can be tried out in advance without the dangers of real operation for example maintaining a nucle

Poser - software to generate computer animations Poser: Poser through Curious Labs Creates 3-dimentaional complex models which you can view from any angle, distance o

Differentiate between z-buffer method and scan-line method. What is the visibility test made in these methods? Solution : In depth buffer algorithm every pixel location on the


Archeology: along with the advent of the computer, the archeologist has obtained a new tool, computer animation. An object-model can be made comparatively quick and without any we

Explain about the Computer Based Training CBT makes use of a computer system to train people in numerous applications. It makes use of self-assessment and multimedia with minim

Stochastic Animation - Computer Animation This utilizes stochastic processes that are a stochastic process can be identified as a random function. Such randomness could be in

What are the Developments of CAD Now CAD packages can be linked to 3D ink jet printers which produce an actual prototype model by building up layers/slices in fine powder (suc

Orthographic and Oblique Projection - Viewing Transformation Orthographic projection is the easiest form of parallel projection that is commonly utilized for engineering drawi

Passive Computer Animations: That has no option for users to utilize computer graphics today is mostly interactive for example: movies. Frame animation is non-interactive anim