1
0
mirror of https://github.com/moparisthebest/Simba synced 2024-08-13 16:53:59 -04:00

Add more math functions.

This commit is contained in:
Merlijn Wajer 2010-07-26 15:04:56 +02:00
parent 7b9c4082f5
commit 4983e9220c
2 changed files with 127 additions and 0 deletions

View File

@ -191,3 +191,108 @@ function ps_rol(num : longword; shift : byte) : LongWord; extdecl;
begin
result := RolDWord(num,shift);
end;
function ps_tan(e: extended): extended;
begin
result:= tan(e);
end;
function ps_radians(e: extended): extended;
begin
result := e / 180.0 * pi;
end;
function ps_degrees(e: extended): extended;
begin
result := e * 180.0 / pi;
end;
function ps_ArcSin(e: extended): extended;
begin
result := ArcSin(e);
end;
function ps_ArcCos(e: extended): extended;
begin
result := ArcCos(e);
end;
function ps_ArcTan(e: extended): extended;
begin
result := ArcTan(e);
end;
function ps_Cotan(e: extended): extended;
begin
result := Cotan(e);
end;
function ps_Secant(e: extended): extended;
begin
result := Secant(e);
end;
function ps_Cosecant(e: extended): extended;
begin
result := Cosecant(e);
end;
function ps_Cot(e: extended): extended;
begin
result := Cot(e);
end;
function ps_Sec(e: extended): extended;
begin
result := Sec(e);
end;
function ps_Csc(e: extended): extended;
begin
result := Csc(e);
end;
function ps_Cosh(e: extended): extended;
begin
result := Cosh(e);
end;
function ps_Sinh(e: extended): extended;
begin
result := Sinh(e);
end;
function ps_Tanh(e: extended): extended;
begin
result := tanh(e);
end;
function ps_CotH(e: extended): extended;
begin
result := cotan(e);
end;
function ps_SecH(e: extended): extended;
begin
result := secant(e);
end;
function ps_CscH(e: extended): extended;
begin
result := Csc(e);
end;
function ps_ArcCosh(e: extended): extended;
begin
result := ArcCosh(e);
end;
function ps_ArcSinh(e: extended): extended;
begin
result := ArcSinh(e);
end;
function DecRet(e: Extended): Extended;
begin
result := e - Trunc(e);
end;

View File

@ -83,6 +83,28 @@ AddFunction(@ps_hextoint,'function HexToInt(Hex : string) : integer');
AddFunction(@ps_sar,'function sar(AValue : longint; shift : byte) : longint;');
AddFunction(@ps_ror,'function ror(num : longword; shift : byte) : LongWord;');
AddFunction(@ps_rol,'function rol(num : longword; shift : byte) : LongWord;');
AddFunction(@ps_tan, 'function ps_tan(e: extended): extended;');
AddFunction(@ps_radians, 'function radians(e: extended): extended;');
AddFunction(@ps_degrees, 'function degrees(e: extended): extended;');
AddFunction(@ps_ArcSin, 'function ArcSin(e: extended): extended;');
AddFunction(@ps_ArcCos, 'function ArcCos(e: extended): extended;');
AddFunction(@ps_ArcTan, 'function ArcTan(e: extended): extended;');
AddFunction(@ps_Cotan, 'function Cotan(e: extended): extended;');
AddFunction(@ps_Secant, 'function Secant(e: extended): extended;');
AddFunction(@ps_Cosecant, 'function Cosecant(e: extended): extended;');
AddFunction(@ps_Hypot, 'function Hypot(e: extended): extended;');
AddFunction(@ps_Cot, 'function Cot(e: extended): extended;');
AddFunction(@ps_Sec, 'function Sec(e: extended): extended;');
AddFunction(@ps_Csc, 'function Csc(e: extended): extended;');
AddFunction(@ps_Cosh, 'function Cosh(e: extended): extended;');
AddFunction(@ps_Sinh, 'function Sinh(e: extended): extended;');
AddFunction(@ps_Tanh, 'function Tanh(e: extended): extended;');
AddFunction(@ps_CotH, 'function CotH(e: extended): extended;');
AddFunction(@ps_SecH, 'function SecH(e: extended): extended;');
AddFunction(@ps_CscH, 'function CscH(e: extended): extended;');
AddFunction(@ps_ArcCosh, 'function ArcCosh(e: extended): extended;');
AddFunction(@ps_ArcSinh, 'function ArcSinh(e: extended): extended;');
AddFunction(@DecRet, 'function DecRet(e: Extended): Extended;');
{$IFNDEF MML_EXPORT_THREADSAFE}
{window}