Einzelnen Beitrag anzeigen

hesubat

Registriert seit: 25. Dez 2005
Ort: Görlitz
19 Beiträge
 
Delphi 7 Personal
 
#10

Re: Falls Variable(n) vorhanden mache das sonst mache dies

  Alt 27. Apr 2008, 00:15
Was meinst Du zu folgender Loesung:

Code:
procedure TForm1.Button1Click(Sender: TObject);
var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r: REAL; bo1,bo2,bo3,bo4,bo5,bo6:boolean;
begin

bo1:=false; bo2:=false; bo3:=false; bo4:=false; bo5:=false; bo6:=false;
if edit1.text<>'' then begin a := StrToFloat(edit1.Text); bo1:=true; end;
if edit2.text<>'' then begin b := StrToFloat(edit2.Text); bo2:=true; end;
if edit3.text<>'' then begin c := StrToFloat(edit3.Text); bo3:=true; end;
if edit4.text<>'' then begin d := StrToFloat(edit4.Text); bo4:=true; end;
if edit5.text<>'' then begin e := StrToFloat(edit5.Text); bo5:=true; end;
if edit6.text<>'' then begin f := StrToFloat(edit6.Text); bo6:=true; end;
if bo2 and bo3 and bo4 then g := sqrt(sqr(b)+sqr(c)-2*b*c*Cos(d));
if bo1 and bo3 and bo5 then h := sqrt(sqr(a)+sqr(c)-2*a*c*Cos(e));
if bo1 and bo2 and bo6 then i := sqrt(sqr(a)+sqr(b)-2*a*b*Cos(f));
if bo1 and bo2 and bo3 then j := ArcCos((sqr(b)+sqr(c)-sqr(a))/(2*b*c));
if bo1 and bo2 and bo3 then k := ArcCos((sqr(a)+sqr(c)-sqr(b))/(2*a*c));
if bo1 and bo2 and bo3 then l := ArcCos((sqr(a)+sqr(b)-sqr(c))/(2*a*b));
if bo2 and bo4 and bo5 then m := sin(d)*b/sin(e);
if bo1 and bo4 and bo5 then n := sin(e)*a/sin(d);
if bo1 and bo4 and bo6 then o := sin(f)*a/sin(d);
if bo1 and bo2 and bo5 then p := ArcSin((a*Sin(e))/b);
if bo1 and bo2 and bo4 then q := ArcSin((b*Sin(d))/a);
if bo1 and bo3 and bo4 then r := ArcSin((c*Sin(d))/a);

edit7.Text := FloatToStr(g);
edit8.text := FloatToStr(h);
edit9.Text := FloatToStr(i);
edit10.Text := FloatToStr(j);
edit11.Text := FloatToStr(k);
edit12.Text := FloatToStr(l);
edit13.Text := FloatToStr(m);
edit14.Text := FloatToStr(n);
edit15.text := FloatToStr(o);
edit16.Text := FloatToStr(p);
edit17.Text := FloatToStr(q);
edit18.Text := FloatToStr(r);

end;
Heinz Subat
  Mit Zitat antworten Zitat