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) With the help of illustrations, briefly describe the influence of the following style on layout and typographic design: (i) Bauhaus (ii) Avant Garde (iii)

What are the side effects due to scan conversion? How can the effects be minimized? Aliasing Effects (Side effects of scan conversion)   Scan conversion is essentially a syst

Question: (a) Using suitable examples, explain the following basic principles of design: (i) Proximity (ii) Repetition (iii) Contrast (iv) Alignment. (b) Color h

Write a program that allows interactive manipulation of the position and orientation of a camera. Draw a teapot at the global origin 0,0,0. You can find a shaded teapot model and

Mathematical description of an Oblique projection onto xy-plane  In order to expand the transformation for the oblique projection, identify the Figure. This figure explains a

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

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.

2-DIMENSIONAL TRANSFORMATION Modeling transformation is the mechanism to compose an image from modeling  primitives. The modeling primitives are defined in their own coordinate

What is uniform rational splines

Methods of Animation - Computer Animation First method: in this, artist makes a succession of cartoon frames that are then combined in a film. Second method: in this,