procedure TAturanKomposisiTrapesium.Panel3Click(Sender: TObject);
Var
C:array[-100..100]of real;
a,b,h,L0,X,L,y,galat:real;
j,i,n,m:integer;
begin
a:=strtofloat(edit1.Text);
b:=strtofloat(edit2.Text);
m:=strtoint(edit3.Text);
n:=m-1;
h:=(b-a)/n ;
j:=-1;
L0:=0;
repeat
j:=j+1;
x:=a+(j*h);
listbox1.items.add(floattostr(j));
listbox2.items.add(formatfloat('0.######',(x)));
C[j]:=x/(1+(x*x));
listbox3.items.add(formatfloat('0.######',(C[j])));
C[-1]:=-(C[j]);
L:=(h/2)*(C[j]+C[j-1]);
if L>0 then listbox4.Items.Add(formatfloat('0.######',(L)));
L0:=L+L0;
edit4.Text:=formatfloat('0.######',(L0));
i:=i+1;
until j=n;
y:= (0.5)*(ln (1+ sqr(b))-ln (1+ sqr (a)));
edit5.text:= formatfloat('0.######',(y));
galat:= abs(y-L0);
edit6.text:= formatfloat('0.######',(galat));
end;
procedure TAturanKomposisiTrapesium.Panel4Click(Sender: TObject);
begin
edit1.Text:='';
edit2.Text:='';
edit3.Text:='';
edit4.Text:='';
edit5.Text:='';
edit6.Text:='';
listbox1.Items.Clear;
listbox2.Items.Clear;
listbox3.Items.Clear;
listbox4.Items.Clear;
end;
procedure TAturanKomposisiTrapesium.Panel5Click(Sender: TObject);
begin
close;
end;
end.
Minggu, 20 November 2016
Langganan:
Posting Komentar (Atom)
0 komentar:
Posting Komentar