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

Scan conversion - 2d shape primitives, Scan conversion: For display of...

Scan conversion: For display of a continuously defined object, a method to map a continuous abstract object or shape into a discrete plane of computer display is needed.  This

What is the use of control points, What is the use of control points?  ...

What is the use of control points?  Spline curve can be specified by giving a set of coordinate positions known as control points, which shows the general shape of the curve, c

3-d modeling and animation tools, 3-D Modeling and Animation Tools: By 3-D...

3-D Modeling and Animation Tools: By 3-D modeling software, objects rendered in perspective show more realistic. One can produce stunning scenes and wander by them, choosing just

Education - applications for computer animation, Education - applications f...

Education - applications for computer animation Currently, studies of subjects as Art, Physics, Maths, Chemistry, Biology, Engineering, Medicine, and Technology are fairly simp

Key frame systems, Ask questionkms eey frame syst #Minimum 100 words accept...

Ask questionkms eey frame syst #Minimum 100 words accepted#

Cathode ray tube - graphics hardware, Cathode Ray Tube - Graphics Hardware ...

Cathode Ray Tube - Graphics Hardware Cathode Ray Tube: this is a refreshing display device. The idea of a refreshing display is depicted pictorially is given as: In fact

Line drawing algorithm, when dda line drawing algorithm is more efficient t...

when dda line drawing algorithm is more efficient than bresenhem line drawing algorithm?

Types of bitmap images, Types of Bitmap Images Bitmap images can includ...

Types of Bitmap Images Bitmap images can include any number of colours but we distinguish among four main categories as: 1)      Line-art: These are images that include

Define clipping, Define clipping and covering (exterior clipping)? Clip...

Define clipping and covering (exterior clipping)? Clipping is the process of cutting a graphics display to neatly fit a predefined graphics region or the view port.  This is

What is shearing, What is shearing?  The shearing transformation actua...

What is shearing?  The shearing transformation actually slants the object with the X direction or the Y direction as needed.ie; this transformation slants the shape of an obje

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