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

Determine the steps uses in cohen sutherland line clipping, Steps uses in t...

Steps uses in the Cohen Sutherland Line Clipping Algorithm are: Figure: Steps for Cohen Sutherland Line Clipping STEP 1: Input:  x L , x R , y T , y B

Graphics image processing-image processing, Graphics Image Processing: The...

Graphics Image Processing: The most generally utilized software is: Photoshop. Characteristics: I.          Most general image processing software. II.         Focuses upon

What is reflection and clipping, What is reflection and clipping? The r...

What is reflection and clipping? The reflection is actually the transformation that makes a mirror image of an object. For this use some angles and lines of reflection.  Cli

Types of animation systems - computer animation, Types of Animation Systems...

Types of Animation Systems - Computer Animation We have discussed above about the sequencing of animation is helpful in developing any animation. Such sequencing is more or le

Scan line polygon fill and seed fill or flood fill algorithm, 1.   Distingu...

1.   Distinguish among Scan line polygon fill and Seed fill or Flood fill algorithm? Scan Line Polygon Flood Fill Algorithms ?1. This

Describe the elements of design pattern, Question: (a) Using suitable ...

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

Three dimensional concepts and display methods, Three Dimensional Concepts ...

Three Dimensional Concepts and Display Methods   Imagine yourself taking a picture by a camera.  What do you normally do?  You specify a viewpoint and view direction and then s

Radiosity - polygon rendering & ray tracing methods, Radiosity - Polygon Re...

Radiosity - Polygon Rendering & Ray Tracing Methods Radiosity simulates the diffuse propagation of light begin at the light sources. Because global illumination is an extremel

Problems at shared vertices - modeling and rendering, Problems at Shared Ve...

Problems at Shared Vertices - Modeling and Rendering Shading discontinuities can arise while two adjacent polygons fail to share a vertex which lies along their common edge.

Card or page based tools, Card or Page Based Tools : In these authoring sy...

Card or Page Based Tools : In these authoring systems, components are organized as pages of a book or a stack of cards. Thousands of pages or cards may be obtainable in the stack

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