作者:lyboy99
e-mail:lyboy99@sina.com
url: http://hnh.126.com
给大家提供几个常用函数,希望可以对你有帮助.
用下面的函数可以轻松,设计个强大的科学
计算机器.
function rnd(arg1:double):double;
Begin
result := Random * int(arg1);
end;
function arcsinh(arg1:double):double;
begin
result:=Ln(arg1+sqrt(1+power(arg1,2)));
end;
function arccosh(arg1:double):double;
begin
result :=Ln(arg1+sqrt(power(arg1,2)-1));
end;
function arctanh(arg1:double):double;
begin
result :=Ln((1+arg1)/(1-arg1))/2;
end;
function arcsech(arg1:double):double;
begin
result :=Ln((1/arg1)+sqrt(power((1/arg1),2)-1));
end;
function arccosech(arg1:double):double;
begin
result :=Ln((1/arg1)+sqrt(1+power((1/arg1),2)));
end;
function arccoth(arg1:double):double;
begin
result :=Ln((1+(1/arg1))/(1-(1/arg1)))/2;
end;
function degarcsin(arg1:double):double;
begin
result :=arcsin(DegToRad(arg1));
end;
function arcsec(arg1:double):double;
begin
result := arccos(1/arg1);
end;
function degarcsec(arg1:double):double;
begin
result := RadToDeg(arccos(1/arg1));
end;
function arccosec(arg1:double):double;
begin
result := arcsin(1/arg1);
end;
function degarccosec(arg1:double):double;
begin
result := RadToDeg(arcsin(1/arg1));
end;
function degarccos(arg1:double):double;
begin
result :=arccos(DegToRad(arg1));
end;
function arccot(arg1:double):double;
begin
result := arctan(1/arg1);
end;
function degarccot(arg1:double):double;
begin
result := RadToDeg(arctan(1/arg1));
end;
function cosech(arg1:double):double;
begin
result := 2/(exp(arg1)-exp(-arg1));
end;
function sech(arg1:double):double;
begin
result := 2/(exp(arg1)+exp(-arg1));
end;
function tanh(arg1:double):double;
begin
result := (exp(arg1)-exp(arg1))/(exp(arg1)+exp(-arg1));
end;
function coth(arg1:double):double;
begin
result := (exp(arg1)+exp(arg1))/(exp(arg1)-exp(-arg1));
end;
function degarctan(arg1:double):double;
begin
result:= RadToDeg(arctan(arg1));
end;
function arg(arg1,arg2:double):double;
begin
if arg1 < 0 then
result := arctan(arg2/arg1)+Pi
else
if arg1>0 then
result := arctan(arg2/arg1)
else
if arg2 > 0 then
&nb