1 unit marek_unit;
2
3 {$mode objfpc}{$H+}
4
5 interface
6
7 uses
8 Classes, SysUtils;
9
10 function gonio(funkce,jednotka:byte;vstup:real):Double;
11
12 implementation
13
14 function gonio(funkce,jednotka:byte;vstup:real):Double;
15 {funkce: 0:sin 1:cos 2:tg; jednotka: 0:radian 1:stupne}
16 begin
17 if jednotka=0 then begin
18 case funkce of
19 0:Result:=sin(vstup);
20 1:Result:=cos(vstup);
21 2:Result:=sin(vstup)/cos(vstup);
22 end;
23 end else begin
24 case funkce of
25 0:Result:=sin(vstup*pi/180);
26 1:Result:=cos(vstup*pi/180);
27 2:Result:=sin(vstup*pi/180)/cos(vstup*pi/180);
28 end;
29 end;
30
31 end;
32
33 end.
34