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

Homogeneous coordinate systems - 2-d and 3-d transformations, Homogeneous C...

Homogeneous Coordinate Systems - 2-d and 3-d transformations Suppose P(x,y) be any point in 2-D Euclidean (Cartesian) system. In HC System, we add a third coordinate to a poin

Specular reflection - polygon rendering & ray tracing method, Specular Refl...

Specular Reflection - Polygon Rendering & Ray Tracing Methods Specular reflection is while the reflection is stronger in one viewing direction that is a bright spot, termed

What is scan line algorithm, What is scan line algorithm?  One way to f...

What is scan line algorithm?  One way to fill the polygon is to apply the inside test. I.e. to check whether the pixel is inside the polygon or outside the polygon and then hig

What is computer-aided design, What is CAD Drawings created with Comput...

What is CAD Drawings created with Computer-Aided Design (CAD) tools, which were introduced in  the 1960s, represented tremendous productivity gains over paper drawings, such as

Tagged image file format, TIFF: It is Tagged Image file format which is us...

TIFF: It is Tagged Image file format which is used mainly for exchanging documents among various applications and computers. This was primarily designed to turn into the standa

Assignemt, i need help in my Engineering graphic assignment

i need help in my Engineering graphic assignment

Area-subdivision method-computer graphics, Normal 0 false fal...

Normal 0 false false false EN-US X-NONE X-NONE

De casteljau algorithm - 2d clipping algorithms, De Casteljau Algorithm ...

De Casteljau Algorithm For computation of Bézier curves an iterative algorithm known as de Casteljau algorithm is used.  The algorithm uses repeated linear interpolation.

Types of light resources - illumination model, Types of Light Resources - i...

Types of Light Resources - illumination Model Let us discuss about the types of light resources. The light sources can not merely be natural like light from Sun or Moon or Sta

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