Grafika Komputer (algoritma Bresenham)

  • Uploaded by: Neike Merlia Elsa
  • 0
  • 0
  • May 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Grafika Komputer (algoritma Bresenham) as PDF for free.

More details

  • Words: 409
  • Pages: 4
1.

Hitung lokasi 7 titik pertama yang dilewati oleh garis (25,15)-(75,50) menggunakan algoritma Bresenham. Gambarkan hasil perhitungannya! Jawab: Garis (25,15)-(75,50) Titik Pertama e = 2*dy-dx = 2*35-50 = 20 dx = (x2-x1) = (75-25) = 50 dy = (y2-y1) = (50-15) = 35 d1 = 2*dy = 2*35 = 70 d2 = 2*(dy-dx) = 2*(35-50) = 2*(-15) = -30 x = 25 ; y = 15 Untuk titik pertama diperoleh x = 25 dan y = 15 Titik Kedua e = 20  e>=0 e = e+d2 = 20+(-30) = -10 x = x+1 = 25+1 = 26 y = y+1 = 15+1 = 16 x = 26 ; y = 16 Untuk titik kedua diperoleh x = 26 dan y = 16

Titik Ketiga e = -10  e<0 e = e+d1 = (-10)+70 = 60 x = x+1 = 26+1 = 27 y = y = 16 x = 27; y = 16 Untuk titik ketiga diperoleh x = 27 dan y = 16 Titik Keempat e = 60  e>=0 e = e+d2 = 60+(-30) = 30 x = x+1 = 27+1 = 28 y = y+1 = 16+1 = 17 x = 28 ; y = 17 Untuk titik keempat diperoleh x = 28 dan y = 17 Titik kelima e = 30  e>=0 e = e+d2 = 30+(-30) =0 x = x+1 = 28+1 = 29 y = y+1 = 17+1 = 18

x = 29 ; y = 18 Untuk titik kelima diperoleh x = 29 dan y = 18 Titik Keenam e = 0  e>=0 e = e+d2 = 0+(-30) = -30 x = x+1 = 29+1 = 30 y = y+1 = 18+1 = 19 x = 30 ; y = 19 Untuk titik keenam diperoleh x = 30 dan y = 19 Titik Ketujuh e = -30  e<0 e = e+d1 = (-30)+70 = 40 x = x+1 = 30+1 = 31 y = y = 19 x = 31; y = 19 Untuk titik ketujuh diperoleh x = 40 dan y = 19

Algoritma Bresenham Garis (25,15)(25,15)-(75,50) Diturunkan Hingga 7 Titik 20 18 16 14 12 10 Y-Values 8 6 4 2 0 0

5

10

15

20

25

30

35

Oleh: Irma Heryani Intan Cintiasih Linda Purnama Dewi Neike Merlia Elsa Pendi Abdul Wahab Pian Agung M

KELAS IF-C/ IV JURUSAN TEKNIK INFORMATIKA FAKULTAS SAINS DAN TEKNOLOGI UNIVERSITAS ISLAM NEGERI SUNAN GUNUNG DJATI BANDUNG 2009

Related Documents

Grafika
December 2019 26
Grafika
November 2019 22
Algoritma
November 2019 46

More Documents from ""