Sie sind auf Seite 1von 1

Draw a line from (0, 0) to (8, 4) in the 1st quadrant using Simple DDA

x1 = 0 y1 = 0
x2 = 8 y2 = 4
Length = 8
dx = 1 dy = 0.5
x = 0.5 y = 0.5

i Plot x y

0.5 0.5

1 (0, 0) 1.5 1.0

2 (1, 1) 2.5 1.5

3 (2, 1) 3.5 2.0

4 (3, 2) 4.5 2.5

5 (4. 2) 5.5 3.0

6 (5, 3) 6.5 3.5

7 (6, 3) 7.5 4.0

8 (7, 4) 8.5 4.5

0 1 2 3 4 5 6 7 8

The example shows that the rasterized line lies to one side of the actual line and that an extra
point occurs at one end of the line; i.e. the algorithm is orientation dependent.

Das könnte Ihnen auch gefallen