Tugas Pengantar Grafik Komputer & Olah Citra**


NPM 31108707 / GANJIL

Cara menghitung posisi pixel hingga mmbentuk sebuah garis yang menghubungkan sebuah titik (12,9) dan (17,14)


  1. End point     Awal     => P1 (12,9) à (X0,Y0)

    Akhir     => P2 (17,13)


  1. ∆X = X2 – X1 = 17 – 12 = 5

    ∆Y = Y2 – Y1 = 13 – 9 = 4

    2∆Y = 2 . 4 = 8

    2∆Y – 2∆X = 2 . 4 – 2 . 5 = -2

    P0 = 2∆Y – ∆X

    = (2.4) – 5

    = 8 – 5

    = 3

K

PK < 0

XK + 1 , YK + 1

PK + 1 = PK + 2∆Y-2∆X

XK + 1 , YK

PK + 1 = PK + 2Y

0

P0 < 0

X0 + 1 , Y0 + 1

P0 + 1 = P0 + 8 – 10

3

12 + 1 , 9 + 1

P1 = 3 + 8 – 10

13 , 10

P1 = 11- 10 = 1

1

P1 < 0

X1 + 1 , Y1 + 2

P1 + 1 = P1 + 8 – 10

1

13 + 1 , 10 + 1

P2 = 1 + 8 – 10

14 , 11

P2 = 9 – 10 = -1

2

P2 < 0

X2 + 1 , Y2

P2 + 1 = P2 +8

-1

14 + 1 , 11

P3 = -1 + 8

15 , 11

P3 = 7

3

P3 < 0

X3 + 1 , Y3 + 4

P3 + 1 = P3 + 8 – 10

7

15 + 1 , 11 + 1

P3 = 7 + 8 – 10

16 , 12

P3 = 15 – 10 = 5

4

P4 < 0

X4 + 1 , Y4 + 5

5

16 + 1 , 12 + 1

17 , 13

2 thoughts on “Tugas Pengantar Grafik Komputer & Olah Citra**

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s