Line segment that joining by using bresenham line algorithm, Computer Graphics

Assignment Help:

Sketch Line Segment That Joining By Using Bresenham Line Algorithm

Example: Sketch line segment that joining (20, 10) and (25, 14) by using Bresenham line generation algorithm.

Solution: (x0, y0) → (20, 10)   ;   (x1, y1) → (25, 14)

m = (y1- y0)/(x1 - x0)

= (14- 10)/(25 - 20)

= 4/5 < 1

Like, m = (Δy)/ (Δx)

= 4/5 =› Δy = 4

→ plot point (20, 10)

pi = 2Δy - Δx

i = 1:                 pi = 2 * 4 - 5 = 3

Here p1 > 0 consequently x0 ← 21; y0 ← 11 now plot (21, 11)

i = 2 as p1 > 0

∴p2 = p1 + 2(Δy - Δx)

= 3 + 2 (4 - 5) = 3 - 2 = 1

p2 > 0; hence x0 ← 22; y0 ← 12 plot (22,12)

i = 3 as p2 > 0

∴p3 = p2 + 2 (Δy - Δx) = 1 + 2 (4 - 5) = - 1

p3 < 0  ∴x0 ← 23

y0 ← 12

plot (23, 12)

i = 4 as p3 < 0

∴p4 = p3 + 2Δy

= -1 + 2 * 4 = 7

∴ x0 ← 24; y0 ← 13

plot (24, 13)

i = 5 as p4 > 0

∴p5 = p4 + 2 (Δy - Δx)

= 7 + 2 (4 - 5) = 5

x0 ← 25; y0 ← 14

Plot (25, 14)

{for i = 6, x0 will be > xi so algorithm terminates


Related Discussions:- Line segment that joining by using bresenham line algorithm

Assumption for digital differential analyzer algorithm, Assumption regardin...

Assumption regarding to the Digital Differential Analyzer Algorithm The line generation by DDA is discussed merely for the first Quadrant, whether the line lies in the other q

Physics - based modeling, Draw the five regular polyhedras using physics-ba...

Draw the five regular polyhedras using physics-based modeling method. Implement a fractal algorithm with possible personal extensions. Also, specify the extensions.

Basics of animation - computer animation, Basics of Animation - Computer an...

Basics of Animation - Computer animation Historical and traditional methods for production of animation: As we have studied the transformations linked in computer graphics

Types of animation, Types of Animation: -          Procedural Animation...

Types of Animation: -          Procedural Animation    -          Representational Animation -          Stochastic Animation                      -          Behavioura

Explain what the term blocking means in animation, Question 1: (a) Exp...

Question 1: (a) Explain what are Final Gathering and Global Illumination and state why you would use those features when you render in MAYA. (b) List clearly the steps in

Time based and presentation tools, Time Based and Presentation Tools In...

Time Based and Presentation Tools In such authoring systems, components and events are organized beside a timeline, along with resolutions as high as 1/30 second. Time based to

What is vanishing point and view reference point, What is vanishing point a...

What is vanishing point and view reference point? The perspective projections of any set of parallel lines that are not parallel to the projection plane converge to appoint cal

Compute the negative of the image, Obtain an MRI image using the Open Sourc...

Obtain an MRI image using the Open Source internet resources. i. Read the image into Scilab ii. Plot the image iii. Covert it into grayscale image and plot it iv. Find/

Curved surfaces, Build a program that allows: 1. using mouse or keyboard...

Build a program that allows: 1. using mouse or keyboard to move around on a set of 16 control points;  2. modify the value (drag along x, y, or z) of a point;  3. display

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