1. Titik awal (15,15) titik akhir (20,20)
= 2/2 = 2/2
= 1 = 1
Algoritma DDA
n= 1
Dx= x1 - x0
Dy
= y1 - y0
= 20 - 15 = 20 - 15
= 5 = 5
|Dx|=|Dy|
maka r =|Dy|
= 5
Xr = Dx/r Yr = Dy/r
= 5/5 = 5/5
= 1 = 1
Xo = X0 + Xr Yo = Yo + Yr
= 15 + 1 = 15 + 1
= 16
=
16
n= 2
Dx = x1 - x0 Dy
= y1 - y0
= 20 - 16 = 20 - 16
= 4 =
4
|Dx|=|Dy|
maka r =|Dy|
= 4
Xr = Dx/r Yr = Dy/r
= 4/4 = 4/4
= 1 = 1
Xo = X0 + Xr Yo = Yo + Yr
= 16 + 1 = 16 + 1
= 17 = 17
n= 3
Dx = x1 - x0
Dy
= y1 - y0
= 20 - 17 = 20 - 17
= 3 =
3
|Dx|=|Dy|
maka r =|Dy|
= 3
Xr = Dx/r Yr = Dy/r
= 3/3 = 3/3
= 1 = 1
Xo = X0 + Xr Yo = Yo + Yr
= 17 + 1 = 17 + 1
= 18 = 18
n= 4
Dx= x1 - x0
Dy = y1 - y0
= 20 - 18 = 20 - 18
= 2 =
2
|Dx|=|Dy|
maka r =|Dy|
= 2
Xr = Dx/r Yr = Dy/r
= 1 = 1
Xo = X0 + Xr Yo = Yo + Yr
= 18 + 1 = 18 + 1
= 19 = 19
n= 5
Dx= x1 - x0
Dy
= y1 - y0
= 20 - 19 = 20 - 19
= 1 = 2
|Dx|=|Dy|
maka r =|Dy|
= 1
Xr = Dx/r Yr = Dy/r
= 1/1 = 1/1
Xo = X0 + Xr Yo = Yo + Yr
= 19 + 1 = 19 + 1
= 20 = 20
2. Algoritma
Bressenhart tidak bias dikerjakan dengan algoritma Gressenhart,
karena syarat algoritma Bressenhart yaitu jika dx < dy atau dx > dy.
Sedangkan kasus yang kami temui adalah dx = dy.
karena syarat algoritma Bressenhart yaitu jika dx < dy atau dx > dy.
Sedangkan kasus yang kami temui adalah dx = dy.
0 Response to " Tugas Grafika Komputer (Algoritma DDA) "
Post a Comment