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

Algorithms for basic line segment plotting, Algorithms for Basic Line Segme...

Algorithms for Basic Line Segment Plotting There are two important algorithms for basic line segment plotting-DDA algorithm and Bresenham algorithm.  Both the algorithms use th

Images - systems research group, The image you have been given for contour ...

The image you have been given for contour extraction is shown in Figure 1. The method for constructing the search space is shown in Figure 2. It is generated from two initial discr

Importance of multimedia, Importance of Multimedia: Multimedia will help i...

Importance of Multimedia: Multimedia will help in spreading the information age to millions of teachers/learners. Today Multimedia educational computing is fastest raising markets

Differences, difference between vecgen and breshnam algorithm

difference between vecgen and breshnam algorithm

Scan line polygon fill algorithm - raster graphics, Scan Line Polygon Fill ...

Scan Line Polygon Fill Algorithm - Raster Graphics In such algorithm, the information for a solid body is stored in the frame buffer and utilizing that information each pixel

Aspect ratio - display devices, Aspect ratio - Display Devices Ratio of...

Aspect ratio - Display Devices Ratio of vertical points to horizontal points necessary to produce equal length lines in both directions on the screen. For example, in a CRT mon

Panning and zooning, what is zooming and panning in computer graph please e...

what is zooming and panning in computer graph please explan??

What is the use of projection reference point, What is the use of Projectio...

What is the use of Projection reference point?  In Perspective projection, the object positions are transformed to the view plane with these converged projection line and the p

Morphing - key frame systems, Morphing - Key Frame Systems Transformati...

Morphing - Key Frame Systems Transformation of object shapes from one form to the other is termed as morphing as short form of metamorphism. This method can be applied to any o

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