unit QUADERSPECIAL;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 =
class(TForm)
Edit1: TEdit;
Edit3: TEdit;
Edit4: TEdit;
Edit5: TEdit;
Edit6: TEdit;
Button1: TButton;
Memo1: TMemo;
Edit2: TEdit;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var a,b,c,d,v,o: real;
begin
if Edit1.Text <> '
'
then
begin
a:=strtofloat(Edit1.Text);
end;
if Edit2.Text <> '
'
then
begin
b:=strtofloat(Edit2.Text);
end;
if Edit3.Text <> '
'
then
begin
c:=strtofloat(Edit3.Text);
end;
if Edit4.Text <> '
'
then
begin
d:=strtofloat(Edit4.Text);
end;
if Edit5.Text <> '
'
then
begin
v:=strtofloat(Edit5.Text);
end;
if Edit6.Text <> '
'
then
begin
o:=strtofloat(Edit6.Text);
end;
repeat
begin
if b=0
then
begin
b:=v/(a*c);
b:=((o/2)-(a*c))/(a+c);
if (a<>0)
and (c<>0)
and (d<>0)
then
begin
b:=sqrt(sqr(d)-sqr(a)-sqr(c));
end;
end;
if a=0
then
begin
a:=v/(b*c);
a:=((o/2)-(b*c))/(b+c);
if (b<>0)
and (c<>0)
and (d<>0)
then
begin
a:=sqrt(sqr(d)-sqr(b)-sqr(c));
end;
end;
if c=0
then
begin
c:=v/(b*a);
c:=((o/2)-(b*a))/(b+a);
if (a<>0)
and (b<>0)
and (d<>0)
then
begin
c:=sqrt(sqr(d)-sqr(b)-sqr(a));
end;
end;
if d=0
then
begin
if (a<>0)
and (c<>0)
and (d<>0)
then
begin
d:=sqrt(sqr(a)+sqr(d)+sqr(c));
end;
end;
if o=0
then
begin
o:=2*(a*b+a*c+b*c);
end;
if v=0
then
begin
v:=a*b*c;
end;
end;
until (a<>0)
and (b<>0)
and (c<>0)
and (d<>0)
and (o<>0)
and (v<>0);
memo1.Visible:= True;
Memo1.Clear;
Memo1.Lines.Add('
Seitenlänge a ' + FloatToStrF(a, fffixed, 10,2));
Memo1.Lines.Add('
Seitenlänge b ' + FloatToStrF(b, fffixed, 10,2));
Memo1.Lines.Add('
Seitenlänge c ' + FloatToStrF(c, fffixed, 10,2));
Memo1.Lines.Add('
Diagonale d ' + FloatToStrF(d, fffixed, 10,2));
Memo1.Lines.Add('
Volumen V ' + FloatToStrF(v, fffixed, 10,2));
Memo1.Lines.Add('
Oberfläche O ' + FloatToStrF(o, fffixed, 10,2));
end;
end.