Interpolasi Lagrange Menggunakan Program Delphi

Screenshot (59)

Gambar Interpolasi Metode Lagrange

Pseudo code :

procedure TForm1.Button1Click(Sender: TObject);
var
a,b,c,d,e,f,g,h,i,j,x,m,n,o,p,q,s:real;
begin
a:=strtofloat(edit1.Text);
b:=strtofloat(edit2.Text);
c:=strtofloat(edit3.Text);
d:=strtofloat(edit4.Text);
e:=strtofloat(edit5.Text);
f:=strtofloat(edit6.Text);
g:=strtofloat(edit7.Text);
h:=strtofloat(edit8.Text);
i:=strtofloat(edit9.Text);
j:=strtofloat(edit10.Text);
x:=strtofloat(edit11.Text);
m:=((x-b)(x-c)(x-d)(x-e))/((a-b)(a-c)(a-d)(a-e));
n:=((x-a)(x-c)(x-d)(x-e))/((b-a)(b-c)(b-d)(b-e));
o:=((x-b)(x-a)(x-d)(x-e))/((c-b)(c-a)(c-d)(c-e));
p:=((x-b)(x-c)(x-a)(x-e))/((d-b)(d-c)(d-a)(d-e));
q:=((x-b)(x-c)(x-d)(x-a))/((e-b)(e-c)(e-d)(e-a));
s:=(fm)+(gn)+(ho)+(ip)+(jq);
edit12.Text:=floattostr(s);
end;procedure TForm1.Button1Click(Sender: TObject);
var
a,b,c,d,e,f,g,h,i,j,x,m,n,o,p,q,s:real;
begin
a:=strtofloat(edit1.Text);
b:=strtofloat(edit2.Text);
c:=strtofloat(edit3.Text);
d:=strtofloat(edit4.Text);
e:=strtofloat(edit5.Text);
f:=strtofloat(edit6.Text);
g:=strtofloat(edit7.Text);
h:=strtofloat(edit8.Text);
i:=strtofloat(edit9.Text);
j:=strtofloat(edit10.Text);
x:=strtofloat(edit11.Text);
m:=((x-b)
(x-c)(x-d)(x-e))/((a-b)(a-c)(a-d)(a-e));
n:=((x-a)
(x-c)(x-d)(x-e))/((b-a)(b-c)(b-d)(b-e));
o:=((x-b)
(x-a)(x-d)(x-e))/((c-b)(c-a)(c-d)(c-e));
p:=((x-b)
(x-c)(x-a)(x-e))/((d-b)(d-c)(d-a)(d-e));
q:=((x-b)
(x-c)(x-d)(x-a))/((e-b)(e-c)(e-d)(e-a));
s:=(f
m)+(gn)+(ho)+(ip)+(jq);
edit12.Text:=floattostr(s);
end;

Iklan

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout /  Ubah )

Foto Google+

You are commenting using your Google+ account. Logout /  Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout /  Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout /  Ubah )

Connecting to %s