Kesimpulan Dari Gambar 10 Titik Garis "Algoritma Bresenham"

Garis (256, 30) – (10, 147)
X1 = 256         Y1 = 30
X2 = 10                       Y2 = 147

Jawab
Dx       = X2 – X1
            = 10 – 256
            = - 246
Dy       = Y2 – Y1
            = 147 – 30
            = 117
D1       = 2 x dy
            = 2 x 117
            = 234
D2       = 2 x ( dy – dx )
            = 2 x ( 117 – ( - 246 ))
            = 726
TI

E          = d1 –dy
            = 234 – 117
            = 117
X         = x1 = 256
Y         = y1 = 30

T2

E > = 0
117 > = 0 (benar)
Maka
E          = e + d2
            = 117 + 726
            = 843
X         = x + 1
            = 256 + 1 = 257
Y         = y + 1
            = 30 + 1               = 31
Y > = y2
31 > 147 ( salah )           


T3

E > = 0
843 > = 0 (benar)
Maka
E          = e + d2
            = 843 + 726
            = 1569
X         = x + 1
            = 257 + 1 = 258
y          = y + 1
            = 31 + 1 = 32
Y > = y2
32 > = 147 (salah)

           
265










10
264









9

263








8


262







7



261






6




260





5





259




4






258



3







257


2








256

1











30
31
32
33
34
35
36
37
38
39


Comments

Popular posts from this blog

Contoh Laporan Hasil Analisis Jaringan Komputer Lab Dengan Membuat Susunan Statik Menggunakan Cisco Paket Tracker

Microsoft Rilis Age of Empire: Castle Siege di Android

Resmi, Microsoft Gulirkan Windows 10 Creators Update