• Tidak ada hasil yang ditemukan

Tugas 5 Grafikom

N/A
N/A
Protected

Academic year: 2017

Membagikan "Tugas 5 Grafikom"

Copied!
7
0
0

Teks penuh

(1)

TUGAS 5 GRAFIKA KOMPUTER

(Untuk memenuhi Tugas Mata Ajar Grafika Komputer Semester Genap Tahun Pelajaran 2014/2015)

Disusun oleh

Nama

: Ahmad Arif Faizin

NIMq

: 21060112120027

JURUSAN TEKNIK ELEKTRO

FAKULTAS TEKNIK

(2)

1.

Spline Interpolation of Sine Data

1. x = 0:10; 2. y = sin(x); 3. xx = 0:.25:10;

4. yy = spline(x,y,xx); 5. plot(x,y,'o',xx,yy)

2.

Spline Interpolation of Distribution and Specify Endpoint Slopes

1. x = -4:4;

2. y = [0 .15 1.12 2.36 2.36 1.46 .49 .06 0]; 3. cs = spline(x,[0 y 0]);

4. xx = linspace(-4,4,101);

(3)

3.

Spline Interpolation of Angular Data

1. x = pi*[0:.5:2];

2. y = [0 1 0 -1 0 1 0; 3. 1 0 1 0 -1 0 1]; 4. pp = spline(x,y);

5. yy = ppval(pp, linspace(0,2*pi,101));

6. plot(yy(1,:),yy(2,:),'-b',y(1,2:5),y(2,2:5),'or'), axis equal

4.

Spline Interpolation of Sine and Cosine Data

1.

x = 0:.25:1;

2.

Y = [sin(x); cos(x)];

3.

xx = 0:.1:1;

4.

YY = spline(x,Y,xx);
(4)

6.

hold on

7.

plot(x,Y(2,:),'o',xx,YY(2,:),':')

8.

hold off

5. Interpolation

1.

x = 2*pi*[0 1 .1:.2:.9];

2.

y = cos(x);

3.

cs = csapi(x,y);

4.

fnplt(cs,2);

5.

axis([-1 7 -1.2 1.2])

6.

hold on

7.

plot(x,y,'o')

8.

hold off

6. Linear interpolation

1.

x = 2*pi*[0 1 .1:.2:.9];

2.

y = cos(x);
(5)

5.

fnplt(csp,'g')

6.

hold off

7.

cs = csapi(x,y);

8.

pl = spapi(2, x, y);

9.

hold on

10.

fnplt(pl, 'r', 2)

11.

hold off

7. Knot Selection

1.

x = linspace(0,10,101);

2.

y = exp(x);

3.

sp0 = spap2( augknt(0:2:10,4), 4, x, y );

4.

plot(x,y-fnval(sp0,x),'r','LineWidth',2)

5.

sp1 = spap2( newknt(sp0), 4, x, y );

6.

hold on

7.

plot(x,y-fnval(sp1,x),'k','LineWidth',2)

8.

hold off

9.

Hermite Spline

(6)

2.

y = [-1 -1 -1 0 1 1 1];

3.

t = -3:.01:3;

4.

p = pchip(x,y,t);

5.

s = spline(x,y,t);

6.

plot(x,y,'o',t,p,'-',t,s,'-.')

7.

legend('data','pchip','spline',4)

10.

Cubic Spline Interpolation

1.

x = [1 1.5 2 4.1 5];

2.

y = [1 -1 1 -1 1];

3.

plot(xx,csapi(x,y,xx),'k-',x,y,'ro')

4.

title('Cubic Spline Interpolant to Five Points')

11. Beizer Spline

1. pt1 = [ 5;-10]; 2. pt2 = [18; 18]; 3. pt3 = [38; -5]; 4. pt4 = [45; 15]; 5.

6. cla

(7)

8. placelabel(pt2,'pt_2'); 9. placelabel(pt3,'pt_3'); 10. placelabel(pt4,'pt_4'); 11. xlim([0 50])

12. axis equal

13. pts = kron((1-t).^3,pt1) + t).^2.*t,pt2) + kron(3*(1-t).*t.^2,pt3) + kron(t.^3,pt4);

14.

15. hold on

Referensi

Dokumen terkait

Pembuatan Video Profil Desa Sidoasri (Film Dokumenter) Sebagai Strategi Promosi Bagi Pengembangan Desa Pemekaran.

EFEKTIVITAS PENDEKATAN KONSTRUKTIVISME UNTUK MENINGKATKAN HASIL BELAJAR SISWA PADA PEMBELAJARAN MATEMATIKA.. Universitas Pendidikan Indonesia | repository.upi.edu

[r]

Perkembangan ilmu dan teknologi yang semakin pesat dewasa ini sangat berpengaruh terhadap kemajuan organisasi di sektor pemerintah maupun swasta Semua kegiatan dan

Bahan uji yang digunakan adalah ekstrak etanol kayu siwak dengan metode perkolasi yang telah diencerkan pada konsentrasi 25 % hingga 0,09 %.. Daya antibakteri ditentukan

Ukuran mesin gergaji sangat besar, sehingga akan menyulitkan dalam pemotongan kayu yang berukuran kecil dan mesin tersebut tidak dapat digunakan untuk membuat alur.. Permasalahan

Setiap orang harus memilih salah satu jenis pekerjaan (fungsi) dalam masyarakatnya. Ada orang-orang yang sejak turun-temurun mewarisi kekuasaan sebagai kaum bangsawan atau orang

Apabila Saudara membutuhkan keterangan dan penjelasan lebih lanjut, dapat menghubungi kami sesuai alamat tersebut diatas sampai dengan batas akhir pemasukan dokumen