Antwort
von
nach einem Tag
0
hilfreich
Re: kÖNNT IHR MIR BEI DELPHI Programm helfen?!?!
hier die Unit:
unit dreieckberechnung;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, ExtCtrls, Math,types;
type
TForm1 = class(TForm)
GroupBox2: TGroupBox;
Label3: TLabel;
Label6: TLabel;
Label4: TLabel;
Label7: TLabel;
Label5: TLabel;
Label8: TLabel;
Label9: TLabel;
Label10: TLabel;
Label2: TLabel;
Label1: TLabel;
GroupBox1: TGroupBox;
PaintBox1: TPaintBox;
LabeledEdit1: TLabeledEdit;
LabeledEdit2: TLabeledEdit;
procedure LabeledEdit1Change(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
a,b,c,h:extended;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.LabeledEdit1Change(Sender: TObject);
var
a,b,c,h: extended;
begin
a:=strtofloat(labelededit1.text);
b:=strtofloat(labelededit2.text);
c:=roundto(sqrt(a*a+b*b),-4); //Wurzel aus a² + b² = c
Label1.Caption:=floattostr(c);
Label6.Caption:=floattostr(roundto(180/Pi*arcsin(a/c),-3)); //arcsin a/c ergibt den Winkel alpha im Bogenmaß, 180/Pi wandelt in Grad um
Label7.Caption:=floattostr(roundto(90-180/Pi*arcsin(a/c),-3));
Label8.Caption:=floattostr(90);
h:=roundto(b*sin(arcsin(a/c)),-4);
Label10.Caption:=floattostr(roundto(h,-4));
end;
end.