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

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

Posted Date: 3/22/2013 7:34:23 AM | Location : United States







Related Discussions:- Line segment that joining by using bresenham line algorithm, Assignment Help, Ask Question on Line segment that joining by using bresenham line algorithm, Get Answer, Expert's Help, Line segment that joining by using bresenham line algorithm Discussions

Write discussion on Line segment that joining by using bresenham line algorithm
Your posts are moderated
Related Questions
A convex polygonal region having n- vertices {P 0 , P 1 , P 2 ..., P n - 1 , P n , P 0 } or lattice points to be identified by the user includes the convex window area. To be exact


B-spline curves are piecewise smooth polynomial curves.  B-spline curves are defined over an interval which has been partitioned into sub-intervals. On each subinterval B-sp

Uniform B - spline curve: When the spacing between Knot values is constant, the resulting curve is called a uniform B- spline. Blending function for B- spline curves are defined b

Question: (a) Sound often gives the only effective way to convey an idea, elicit an emotion, or dramatise a point. Explain two situations of the use of sound that would be con

Ray Tracing Algorithm - Recursive Frequently, the basic ray tracing algorithm is termed as a "recursive" acquiring an outcome wherein a given process repeats itself an arbitr

what is the control for Why Video Game Characters Look Better Today

Scientific Visualization This is complex for the human brain to create sense out of the large volume of numbers produced through a scientific computation. Statistical and nume

Key Frames -Traditional Animation Techniques The senior artists go and draw the main frames of the animation, after a storyboard has been laid out. These main frames are frame

What are the different ways of specifying spline curve?  Using a set of boundary conditions that are imposed on the spline. Using the state matrix that characteristics