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

Functioning of input devices - 2d shape primitives, Functioning of Input De...

Functioning of Input Devices Functioning of input devices-Keyboard, mouse, trackball and space ball, Joystick, data glove, digitizer, scanner, touch panel, light pen, voice sys

Dda and bresenhem line drawing algorithm, when dda algorithm is more effici...

when dda algorithm is more efficient than bresenhem line drawing algorithm

Approaches to area filling - output primitives, Approaches to Area Filling ...

Approaches to Area Filling  Some other approaches to area filling are   Scan line polygon fill algorithm Boundary fill algorithm Flood fill algorithm.

Important points about the frame buffers - graphics hardware, Important Poi...

Important Points about the Frame Buffers 1) Within a frame buffer, information storage starts from top left corner and goes until the bottom right corner. 2) By using this

Classic applications of digital video, The table as given below demonstrate...

The table as given below demonstrates possible values of such parameters for classic applications of digital video. Application                  Frame rate                  Dime

Mplab ide software, MPLAB C18 TOOL (MC18) The MPLAB C18 compiler was de...

MPLAB C18 TOOL (MC18) The MPLAB C18 compiler was designed as a full featured ASNI- compliant C - complier for the PIC18 family of 8bits MCUs. MC18 compiler is integrated with c

Scenes - polygon rendering and ray tracing methods, Scenes - polygon render...

Scenes - polygon rendering and ray tracing methods In the context of ray tracing, a scene is a set of objects and light sources which will be viewed through a camera. All of

Basic ray tracing algorithm - polygon rendering, Basic Ray Tracing Algorith...

Basic Ray Tracing Algorithm - Polygon Rendering The Hidden-surface removal is the most complete and most versatile method for display of objects in a realistic fashion. The co

3d studio max -softwares for computer animation, 3DStudio Max -Softwares fo...

3DStudio Max -Softwares for computer animation The successor to 3-DStudio 3.0, 3-DStudio Max runs in WindowsNT. This is completely object-oriented, featuring new enhancements a

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