unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, math;
type
TForm1 = class(TForm)
Testo: TEdit;
txtsin: TLabeledEdit;
txtcos: TLabeledEdit;
txttg: TLabeledEdit;
txtcotg: TLabeledEdit;
txtsec: TLabeledEdit;
txtcosec: TLabeledEdit;
rdbsin: TRadioButton;
rdbcos: TRadioButton;
rdbtg: TRadioButton;
rdbcotg: TRadioButton;
rdbsec: TRadioButton;
rdbcosec: TRadioButton;
Button1: TButton;
Label1: TLabel;
rdbnum: TRadioButton;
procedure Button1Click(Sender: TObject);
procedure rdbsinClick(Sender: TObject);
procedure rdbcosClick(Sender: TObject);
procedure rdbtgClick(Sender: TObject);
procedure rdbcotgClick(Sender: TObject);
procedure rdbsecClick(Sender: TObject);
procedure rdbcosecClick(Sender: TObject);
procedure rdbnumClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
txtsin.clear;
txtcos.clear;
txttg.clear;
txtcotg.clear;
txtsec.Clear;
txtcosec.Clear;
if rdbsin.checked=true then
begin
txtcos.Text:=floattostr(sqrt(1-(sqr(strtofloat(testo.text))))); //cos= +- radice di(1-(seno)*(seno)
txttg.Text:=floattostr(strtofloat(testo.Text)/(sqrt(1-(sqr(strtofloat(testo.text))))));//tan= +- seno/coseno
txtcotg.Text:=floattostr((sqrt(1-(sqr(strtofloat(testo.text)))))/strtofloat(testo.Text));//cotan=+- coseno /seno
txtsec.Text:=floattostr(1/(sqrt(1-(sqr(strtofloat(testo.text))))));//secan= 1 /coseno
txtcosec.Text:=floattostr(1/strtofloat(testo.Text));//cosecant= 1 /seno
end;
if rdbcos.checked=true then
begin
txtsin.Text:=floattostr(sqrt(1-(sqr(strtofloat(testo.text))))); // sin= +- radice di(1-(coseno)*(coseno)
txttg.Text:=floattostr((sqrt(1-(sqr(strtofloat(testo.text)))))/strtofloat(testo.Text));//tan=+- seno/coseno
txtcotg.Text:=floattostr(strtofloat(testo.Text)/(sqrt(1-(sqr(strtofloat(testo.text))))));//cotan+- coseno /seno
txtsec.Text:=floattostr(1/strtofloat(testo.Text));// secan= 1 /coseno
txtcosec.Text:=floattostr(1/(sqrt(1-(sqr(strtofloat(testo.text))))));//cosecant= 1 /seno
end;
if rdbtg.checked=true then
begin
txtsin.Text:=floattostr((strtofloat(testo.text))/sqrt(1+(sqr(strtofloat(testo.text))))); // sin= +- tan/ radice(1+(tan)*(tan))
txtcos.Text:=floattostr(1/sqrt(1+sqr(strtofloat(testo.text))));//cos=+- 1/(radice(1+(tan)*(tan)))
txtcotg.Text:=floattostr(1/strtofloat(testo.Text));//cotan =1/tan
txtsec.Text:=floattostr(sqrt(1+sqr(strtofloat(testo.text))));// secan= radice(1+(tan)*(tan))
txtcosec.Text:=floattostr(sqrt(1+sqr(strtofloat(testo.text)))/strtofloat(testo.text));//cosecant= (radice(1+(tan)*(tan)))/tan
end;
if rdbcotg.checked=true then
begin
txtsin.Text:=floattostr(1/sqrt(1+sqr(strtofloat(testo.text))));//sin=+- 1/1+(cotan)*(cotan)
txtcos.Text:=floattostr((strtofloat(testo.text))/sqrt(1+(sqr(strtofloat(testo.text))))); // cos= cotan/ radice(1+(cotan)*(cotan))
txttg.Text:=floattostr(1/strtofloat(testo.Text));//tan =1/cotan
txtsec.Text:=floattostr(sqrt(1+(sqr(strtofloat(testo.text))))/(strtofloat(testo.text)));// secan= (1+(cotan)*(cotan)))/ cotan
txtcosec.Text:=floattostr(sqrt(1+(sqr(strtofloat(testo.text)))));//cosecant=1+(cotan)*(cotan))
end;
if rdbsec.checked=true then
begin
txtsin.Text:=floattostr(sqrt(sqr(strtofloat(testo.text)-1))/strtofloat(testo.Text));//sin= radice((sec)*(sec)-1)/sec
txtcos.Text:=floattostr(1/strtofloat(testo.Text)); // cos= 1/sec
txttg.Text:=floattostr(sqrt(sqr(strtofloat(testo.text)-1)));//tan =radice ((sec)*(sec)-1)
txtcotg.Text:=floattostr(1/sqrt(sqr(strtofloat(testo.text)-1)));// cotan= 1/radice ((sec)*(sec)-1)
txtcosec.Text:=floattostr(strtofloat(testo.Text)/(sqrt(sqr(strtofloat(testo.text)-1))));//cosecant=sec/radice((sec)*(sec)-1)
end;
if rdbcosec.checked=true then
begin
txtsin.Text:=floattostr(1/(strtofloat(testo.text)-1));//sin=
txtcos.Text:=floattostr(sqrt(sqr(strtofloat(testo.text)-1))/strtofloat(testo.text)); // cos=
txttg.Text:=floattostr(1/(sqrt(sqr(strtofloat(testo.text)-1))));//tan =
txtcotg.Text:=floattostr(sqrt(sqr(strtofloat(testo.text)-1)));// cotan=
txtsec.Text:=floattostr(strtofloat(testo.text)/(sqrt(sqr(strtofloat(testo.text)-1))));//cosec=
end;
if rdbnum.checked=true then
begin
txtsin.Text:=floattostr((sin(degtorad(strtofloat(testo.text)))));
txtcos.Text:=floattostr((cos(degtorad(strtofloat(testo.text)))));
txttg.Text:=floattostr((tan(degtorad(strtofloat(testo.text)))));
txtcotg.Text:=floattostr((cotan(degtorad(strtofloat(testo.text)))));
txtsec.Text:=floattostr((secant(degtorad(strtofloat(testo.text)))));
txtcosec.Text:=floattostr((cosecant(degtorad(strtofloat(testo.text)))));
end;
end;
procedure TForm1.rdbsinClick(Sender: TObject);
begin
label1.Caption:=rdbsin.Caption;
end;
procedure TForm1.rdbcosClick(Sender: TObject);
begin
label1.Caption:=rdbcos.Caption;
end;
procedure TForm1.rdbtgClick(Sender: TObject);
begin
label1.Caption:=rdbtg.Caption;
end;
procedure TForm1.rdbcotgClick(Sender: TObject);
begin
label1.Caption:=rdbcotg.Caption;
end;
procedure TForm1.rdbsecClick(Sender: TObject);
begin
label1.Caption:=rdbsec.Caption;
end;
procedure TForm1.rdbcosecClick(Sender: TObject);
begin
label1.Caption:=rdbcosec.Caption;
end;
procedure TForm1.rdbnumClick(Sender: TObject);
begin
label1.Caption:=rdbnum.Caption;
end;
end.