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

Macintosh - hardware for computer animation, Macintosh - Hardware for compu...

Macintosh - Hardware for computer animation It was originally designed to be graphic and desktop publishing machines. Macs did not turn into which widely known till recently, a

Homogeneous coordinates, What are the uses of homogeneous coordinates? Conv...

What are the uses of homogeneous coordinates? Convert translation rotation and scaling in homogeneous coordinates. In mathematics homogeneous coordinates introduced by August

Digital audio comprises audio signals, Digital audio comprises audio signal...

Digital audio comprises audio signals stored in a digital format. Particularly, the term encompasses the subsequent: 1)   Audio conversion: 1.   Analogue to digital conversi

Arguments made in favour of analog sound, Arguments made in favour of Analo...

Arguments made in favour of Analog Sound Shape of the waveforms: from digital signals sound reconstructed which is claimed to be harsher and unnatural compared to analog si

Geometrical examine types of line clipping, Geometrical examine Types of Li...

Geometrical examine Types of Line Clipping Geometrical examine of the above kinds of clipping (it assists to get point of intersection of line PQ along with any edge). Assu

Perspective projection, Perspective Projection 1. Perspective projectio...

Perspective Projection 1. Perspective projection gives more realistic appearance and uses the same principle as used in camera. 2. Perspective projection is not an affine tr

Procedural animation - computer animation, Procedural Animation - Computer ...

Procedural Animation - Computer Animation This category of animation is utilized to produce real time animation that permits a more diverse series of actions to occur. These a

Liang barsky line clipping algorithm, Liang Barsky line clipping algorithm ...

Liang Barsky line clipping algorithm : The algorithm uses parametric form of the line segment.  Four inequalities are created using the parametric form of the line segments.  Th

Various ways of simulating motion, Various ways of simulating motion:- ...

Various ways of simulating motion:- -        Zero Acceleration (Constant Speed)           -        Non-Zero Accelerations -        Positive accelerations

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