[
Contact
]
[
Links
]
[
Previous : 16 / 20 : Another look at Bresenham (2)
]
[
Up
]
[
Next : 18 / 20 : Another look at Bresenham (4)
]
Another look at Bresenham (3)
Let's get rid of float operations
the following decision parameter has the same sign as d1 - d2 :
(4) Pk = DX ( d1 - d2) = 2 DY . x
k
- 2 DX . y
k
+ c = DX( 2 m (x
k
+ 1) - 2 yk + 2b -1)
with c = constante = 2 DY + DX (2b -1)
Let's get rid of multiplications
P
k+1
= 2 DY . x
k+1
- 2 DX .y
k+1
+ c
P
k+1
- P
k
= 2 DY (x
k+1
- x
k
) - 2 DX (y
k+1
- y
k
) (get rid of the constance)
P
k+1
= P
k
+ 2 DY - 2 DX (y
k+1
- y
k
)
P
k+1
= P
k
+ D'Y or = P
k
+ D'Y - D'X
with (y
k+1
- y
k
) = 0 or 1 depending on Pk sign
(Pk < 0 <=> 0) and D'Y = 2 DY and D'X = 2 DX
P0 = 2DY - DX ( = 2 DY . x
0
- 2 DX . y
0
+ 2 DY + DX (2b -1) )
(in our implemented algo, 'fraction' is the decision parameter Pk)
eScience
<
Computer Graphics
:
Line drawing
>
[
Contact
]
[
Links
]
[
Previous : 16 / 20 : Another look at Bresenham (2)
]
[
Up
]
[
Next : 18 / 20 : Another look at Bresenham (4)
]
See the "Links" link above to find out the sources of the proposed informations
Pascal Vuylsteker
/
eScience
/
Computer Science
/
ANU
Last modified: 20/4/2004
TOC
-
Print
Send your comments at :
<Hugh.Fisher@anu.edu.au>