Morgen =)
folgendes...
ich will wie im Titel genannt den Satz des Pythagoras umsetzten.
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25:
| procedure TForm1.Button4Click(Sender: TObject); var a,b,c,al,bt,ga : Real ; begin begin a := StrToFloatDef(edit5.Text,0); b := StrToFloatDef(edit6.Text,0); c := StrToFloatDef(edit7.text,0); if (b>0) and (c>0) and (a<=0) then a := sqr(b)+sqr(c)-2*b*c*cos(al); end; begin if (c>0) and (a>0) and (b<=0) then b := sqr(a)+sqr(c)-2*a*c*cos(bt); end; begin if (a>0) and (b>0) and (c<=0) then c := sqr(a)+sqr(b)-2*a*b*cos(ga); end; Label36.Caption := FloatToStr(a); Label38.Caption := FloatToStr(b); Label40.Caption := FloatToStr(c); end;
end. |
Bei mir ist es der Fall, das die drei Winkel immer gegeben sind..nur iwie komm ich nicht dahinter mit diesem Bogenmaß..muss ich an den stellen wo cos etc steht mit dem RadToDeg arbeiten ?!
Weil die Ergebnisse nicht richtig sind =)