unit uScatMain; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) OpenDialog1: TOpenDialog; Edit1: TEdit; Button1: TButton; Label1: TLabel; Button2: TButton; Label2: TLabel; Label3: TLabel; Label4: TLabel; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); private { Private declarations } public { Public declarations } end; Ponto = Class Public x,y,F:real; end; ListaDePontos = array of Ponto; const Pequeno=0.00001; var Form1: TForm1; N,Nx,Ny:integer; P:ListaDePontos; Xmin,Xmax,Ymin,Ymax:real; implementation {$R *.DFM} procedure TForm1.Button1Click(Sender: TObject); var F:textfile; erro,i:integer; begin OpenDialog1.Execute; Label3.Caption:='Nome do Arquivo de Entrada:'+OpenDialog1.FileName; Label4.Caption:=''; {$I-} AssignFile(F,OpenDialog1.FileName); Reset(F); erro:=IOResult; if erro=0 then begin read(F, N,Nx,Ny); erro:=IOResult; if erro=0 then begin SetLength(P,N); Xmin:=10000000; Xmax:=-10000000; Ymin:=10000000; Ymax:=-10000000; for i:=0 to N-1 do begin P[i]:=Ponto.create; read(F,P[i].x,P[i].y,P[i].F); erro:=IOResult; if erro<>0 then break; if P[i].xXmax then Xmax:=P[i].x; if P[i].yYmax then Ymax:=P[i].y; end; closefile(F); if erro=0 then Button2.Enabled:=True; end; end; if erro<>0 then begin Label4.Caption:='Problemas no Arquivo de Entrada.'; Button2.Enabled:=False; end; end; function shepard(x,y:real):real; var S:real; i:integer; D:real; begin S:=0; D:=0; for i:=0 to N-1 do begin if (abs(P[i].x-x)0 then begin Label4.Caption:='Problemas no Arquivo de Saída.'; Button2.Enabled:=False; end; end; end.