Questo sito utilizza cookies solo per scopi di autenticazione sul sito e nient'altro. Nessuna informazione personale viene tracciata. Leggi l'informativa sui cookies.
Username: Password: oppure
Trigoniometria - Unit1.pas

Unit1.pas

Caricato da: Anonymous
Scarica il programma completo

  1. unit Unit1;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  7.   Dialogs, StdCtrls, ExtCtrls, math;
  8.  
  9. type
  10.   TForm1 = class(TForm)
  11.     Testo: TEdit;
  12.     txtsin: TLabeledEdit;
  13.     txtcos: TLabeledEdit;
  14.     txttg: TLabeledEdit;
  15.     txtcotg: TLabeledEdit;
  16.     txtsec: TLabeledEdit;
  17.     txtcosec: TLabeledEdit;
  18.     rdbsin: TRadioButton;
  19.     rdbcos: TRadioButton;
  20.     rdbtg: TRadioButton;
  21.     rdbcotg: TRadioButton;
  22.     rdbsec: TRadioButton;
  23.     rdbcosec: TRadioButton;
  24.     Button1: TButton;
  25.     Label1: TLabel;
  26.     rdbnum: TRadioButton;
  27.     procedure Button1Click(Sender: TObject);
  28.     procedure rdbsinClick(Sender: TObject);
  29.     procedure rdbcosClick(Sender: TObject);
  30.     procedure rdbtgClick(Sender: TObject);
  31.     procedure rdbcotgClick(Sender: TObject);
  32.     procedure rdbsecClick(Sender: TObject);
  33.     procedure rdbcosecClick(Sender: TObject);
  34.     procedure rdbnumClick(Sender: TObject);
  35.   private
  36.     { Private declarations }
  37.   public
  38.     { Public declarations }
  39.   end;
  40.  
  41. var
  42.   Form1: TForm1;
  43.  
  44. implementation
  45.  
  46. {$R *.dfm}
  47.  
  48. procedure TForm1.Button1Click(Sender: TObject);
  49. begin
  50.  txtsin.clear;
  51.  txtcos.clear;
  52.  txttg.clear;
  53.  txtcotg.clear;
  54.  txtsec.Clear;
  55.  txtcosec.Clear;
  56.  
  57.  if rdbsin.checked=true then
  58.   begin
  59.    txtcos.Text:=floattostr(sqrt(1-(sqr(strtofloat(testo.text))))); //cos= +- radice di(1-(seno)*(seno)
  60.    txttg.Text:=floattostr(strtofloat(testo.Text)/(sqrt(1-(sqr(strtofloat(testo.text))))));//tan= +- seno/coseno
  61.    txtcotg.Text:=floattostr((sqrt(1-(sqr(strtofloat(testo.text)))))/strtofloat(testo.Text));//cotan=+- coseno /seno
  62.    txtsec.Text:=floattostr(1/(sqrt(1-(sqr(strtofloat(testo.text))))));//secan= 1 /coseno
  63.    txtcosec.Text:=floattostr(1/strtofloat(testo.Text));//cosecant=  1 /seno
  64.   end;
  65.  
  66.  if rdbcos.checked=true then
  67.   begin
  68.    txtsin.Text:=floattostr(sqrt(1-(sqr(strtofloat(testo.text))))); // sin= +- radice di(1-(coseno)*(coseno)
  69.    txttg.Text:=floattostr((sqrt(1-(sqr(strtofloat(testo.text)))))/strtofloat(testo.Text));//tan=+- seno/coseno
  70.    txtcotg.Text:=floattostr(strtofloat(testo.Text)/(sqrt(1-(sqr(strtofloat(testo.text))))));//cotan+- coseno /seno
  71.    txtsec.Text:=floattostr(1/strtofloat(testo.Text));// secan= 1 /coseno
  72.    txtcosec.Text:=floattostr(1/(sqrt(1-(sqr(strtofloat(testo.text))))));//cosecant= 1 /seno
  73.   end;
  74.  
  75.  if rdbtg.checked=true then
  76.   begin
  77.    txtsin.Text:=floattostr((strtofloat(testo.text))/sqrt(1+(sqr(strtofloat(testo.text))))); // sin= +- tan/ radice(1+(tan)*(tan))
  78.    txtcos.Text:=floattostr(1/sqrt(1+sqr(strtofloat(testo.text))));//cos=+- 1/(radice(1+(tan)*(tan)))
  79.    txtcotg.Text:=floattostr(1/strtofloat(testo.Text));//cotan =1/tan
  80.    txtsec.Text:=floattostr(sqrt(1+sqr(strtofloat(testo.text))));// secan= radice(1+(tan)*(tan))
  81.    txtcosec.Text:=floattostr(sqrt(1+sqr(strtofloat(testo.text)))/strtofloat(testo.text));//cosecant= (radice(1+(tan)*(tan)))/tan
  82.   end;
  83.  
  84.  if rdbcotg.checked=true then
  85.   begin
  86.    txtsin.Text:=floattostr(1/sqrt(1+sqr(strtofloat(testo.text))));//sin=+- 1/1+(cotan)*(cotan)
  87.    txtcos.Text:=floattostr((strtofloat(testo.text))/sqrt(1+(sqr(strtofloat(testo.text))))); // cos= cotan/ radice(1+(cotan)*(cotan))
  88.    txttg.Text:=floattostr(1/strtofloat(testo.Text));//tan =1/cotan
  89.    txtsec.Text:=floattostr(sqrt(1+(sqr(strtofloat(testo.text))))/(strtofloat(testo.text)));// secan= (1+(cotan)*(cotan)))/ cotan
  90.    txtcosec.Text:=floattostr(sqrt(1+(sqr(strtofloat(testo.text)))));//cosecant=1+(cotan)*(cotan))
  91.   end;
  92.  
  93.  if rdbsec.checked=true then
  94.   begin
  95.    txtsin.Text:=floattostr(sqrt(sqr(strtofloat(testo.text)-1))/strtofloat(testo.Text));//sin= radice((sec)*(sec)-1)/sec
  96.    txtcos.Text:=floattostr(1/strtofloat(testo.Text)); // cos= 1/sec
  97.    txttg.Text:=floattostr(sqrt(sqr(strtofloat(testo.text)-1)));//tan =radice ((sec)*(sec)-1)
  98.    txtcotg.Text:=floattostr(1/sqrt(sqr(strtofloat(testo.text)-1)));// cotan= 1/radice ((sec)*(sec)-1)
  99.    txtcosec.Text:=floattostr(strtofloat(testo.Text)/(sqrt(sqr(strtofloat(testo.text)-1))));//cosecant=sec/radice((sec)*(sec)-1)
  100.   end;
  101.  
  102.  if rdbcosec.checked=true then
  103.   begin
  104.    txtsin.Text:=floattostr(1/(strtofloat(testo.text)-1));//sin=
  105.    txtcos.Text:=floattostr(sqrt(sqr(strtofloat(testo.text)-1))/strtofloat(testo.text)); // cos=
  106.    txttg.Text:=floattostr(1/(sqrt(sqr(strtofloat(testo.text)-1))));//tan =
  107.    txtcotg.Text:=floattostr(sqrt(sqr(strtofloat(testo.text)-1)));// cotan=
  108.    txtsec.Text:=floattostr(strtofloat(testo.text)/(sqrt(sqr(strtofloat(testo.text)-1))));//cosec=
  109.   end;
  110.  
  111.  if rdbnum.checked=true then
  112.   begin
  113.    txtsin.Text:=floattostr((sin(degtorad(strtofloat(testo.text)))));
  114.    txtcos.Text:=floattostr((cos(degtorad(strtofloat(testo.text)))));
  115.    txttg.Text:=floattostr((tan(degtorad(strtofloat(testo.text)))));
  116.    txtcotg.Text:=floattostr((cotan(degtorad(strtofloat(testo.text)))));
  117.    txtsec.Text:=floattostr((secant(degtorad(strtofloat(testo.text)))));
  118.    txtcosec.Text:=floattostr((cosecant(degtorad(strtofloat(testo.text)))));
  119.   end;
  120. end;
  121.  
  122. procedure TForm1.rdbsinClick(Sender: TObject);
  123. begin
  124.  label1.Caption:=rdbsin.Caption;
  125. end;
  126.  
  127. procedure TForm1.rdbcosClick(Sender: TObject);
  128. begin
  129.  label1.Caption:=rdbcos.Caption;
  130. end;
  131.  
  132. procedure TForm1.rdbtgClick(Sender: TObject);
  133. begin
  134.  label1.Caption:=rdbtg.Caption;
  135. end;
  136.  
  137. procedure TForm1.rdbcotgClick(Sender: TObject);
  138. begin
  139.  label1.Caption:=rdbcotg.Caption;
  140. end;
  141.  
  142. procedure TForm1.rdbsecClick(Sender: TObject);
  143. begin
  144.  label1.Caption:=rdbsec.Caption;
  145. end;
  146.  
  147. procedure TForm1.rdbcosecClick(Sender: TObject);
  148. begin
  149.  label1.Caption:=rdbcosec.Caption;
  150. end;
  151.  
  152. procedure TForm1.rdbnumClick(Sender: TObject);
  153. begin
  154.  label1.Caption:=rdbnum.Caption;
  155. end;
  156.  
  157. end.