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
Implement the Scan line polygon fill algorithm for any arbitrary polygon in C-language and then use your code to fill each of the following type of polygon. i)  Convex polygon

Scale a sphere cantered on the point (1, 2, and 3) with radius 1, so that the new sphere has the same centre with radius 2.    Solution: Translate the sphere so that its centre

Question: a) Datagram packet delivery and Virtual circuit packet delivery are two approaches to the delivery of packets by the network layer. Explain. b) What is the meaning

The RIA should consist of: i) A simple Graphical User Interface (GUI) constructed from a simple navigation system (comprising of around 5 key frames) making use of the Flash tim

Determine the transformation matrix for the reflection, Computer Graphics

Bezier Curves - Modeling and Rendering Bezier curves are utilized in computer graphics to turn out curves which display reasonably smooth at all scales. Such spline approximat

What is a Blobby object?  Some objects do not handle a fixed shape, but change their surface characteristics in sure motions or when in proximity to other objects. That is call

What is Polygon mesh?  Polygon mesh is a method to show the polygon, when the object surfaces are tiled, it is more convenient to state the surface facets with a mesh function.

What are the side effects due to scan conversion? How can the effects be minimized? Aliasing Effects (Side effects of scan conversion)   Scan conversion is essentially a syst

Cyrus Beck Algorithm - Line Clipping Algorithm Cyrus Beck Line clipping algorithm is actually, a parametric line-clipping algorithm. The term parametric means that we requi