You are on page 1of 4

PROGRAMA ESCALERA BUENO

unit cal;

interface

uses

Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,

StdCtrls;

type

TForm1 = class(TForm)

Label1: TLabel;

Edit1: TEdit;

Label2: TLabel;

Edit2: TEdit;

Calcular: TButton;

Terminar: TButton;

Label3: TLabel;

Edit3: TEdit;

Label4: TLabel;

Edit4: TEdit;

Label5: TLabel;

Edit5: TEdit;

procedure CalcularClick(Sender: TObject);

procedure TerminarClick(Sender: TObject);

private

{ Private declarations }

public
{ Public declarations }

end;

var

Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.CalcularClick(Sender: TObject);

Const

Pi= 3.141592654;

var

A1,D,C,W2,W1,F,Fd,C1,Xl,Z,Angulo: Extended;

label lab1, lab2;

begin

A1:=StrToFloat(Edit4.text);

D:=(180.0-A1)/(180.0/Pi);

W2:=StrToFloat(Edit3.text);

W1:=StrToFloat(Edit1.text);

C:=0.01;

lab1:

F:=W2*cos(D-C)/(sin(D-C)*sin(D-C))-W1*cos(C)/(sin(C)*sin(C));

Fd:=W2*(sin(D-C)*sin(D-c)+2*cos(D-C)*cos(D-C))/(sin(D-C)*sin(D-C)*sin(D-C));

Fd:= Fd + W1*(sin(C)*sin(C)+2*cos(C)*cos(C))/(sin(C)*sin(C)*sin(C));

C1:= C-F/Fd;

Z:=C1-C;

if Z <> 0.0 Then

begin
if z< 0.0 then

if z+0.001 < 0.0 then

begin

c:=c1;

goto lab1;

end

else

goto lab2

else

if z-0.001 <= 0.0 then

goto Lab2

else

begin

c:= c1;

goto Lab1

end;

end;

lab2:

Angulo:= c1*180/pi;

xl := w2/sin(D-c1)+ w1/sin(c1);

Edit2.text := FloatToStr(Xl);

Edit5.text := FloatToStr(Angulo);

end;

procedure TForm1.TerminarClick(Sender: TObject);

begin

application.terminate

end;

end.

You might also like