Professional Documents
Culture Documents
Eliminacion de Gauss (Matrices)
Eliminacion de Gauss (Matrices)
ELIMINACIÓN DE
GAUSS
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls,
Forms,
Dialogs, StdCtrls, math;
type
TForm1 = class(TForm)
capturar: TButton;
Label1: TLabel;
matriz: TMemo;
bs: TMemo;
Button1: TButton;
Button2: TButton;
matriz2: TMemo;
bs2: TMemo;
det: TLabel;
Label2: TLabel;
Label3: TLabel;
x1: TLabel;
procedure capturarClick(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
a: array of array of double;
b,x: array of double;
n:integer;
factor:double;
implementation
{$R *.dfm}
function Redondear(Valor: Real; Redondeo: Integer):Real;
begin
Redondear := Trunc(Valor * Power(10, Redondeo)) /
Power(10,Redondeo);
end;
//calcular determinante
for i:=0 to n-1 do
d:= redondear(d*a[i][i],9);
det.Caption:='D=' + floattostr(d);
end.