麻豆小视频在线观看_中文黄色一级片_久久久成人精品_成片免费观看视频大全_午夜精品久久久久久久99热浪潮_成人一区二区三区四区

首頁 > 編程 > Delphi > 正文

Delphi下常用數(shù)學運算函數(shù)

2019-11-18 18:47:40
字體:
供稿:網(wǎng)友

Delphi數(shù)學運算函數(shù)
作者:lyboy99
e-mail:[email protected]  
url: http://hnh.126.com
給大家提供幾個常用函數(shù),希望可以對你有幫助.
用下面的函數(shù)可以輕松,設計個強大的科學計算機器.

 

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
          result  := 0.5 * Pi
        else
          result := -0.5 * Pi;
end;

function sinh(arg1:double):double;
begin
    result := (exp(arg1)-exp(-arg1))*0.5;
end;

function cosh(arg1:double):double;
begin
    result  := (exp(arg1)+exp(-arg1))*0.5;
end;


function cot(arg1:double):double;
begin
      if Abs(arg1)>0.000000001 then result  := cotan(arg1) else result :=100000;
end;

function cotrad(arg1:double):double;
begin
    result := cotan(DegToRad(arg1));
end;


function sec(arg1:double):double;
begin
    result := 1/cos(arg1);
end;

function cosec(arg1:double):double;
begin
   if Abs(arg1)>0.000000001 then result:= 1/sin(arg1) else result:=1000000;
end;


function tanrad(arg1:double):double;
begin
    result  := tan(DegToRad(arg1));
end;

function sinrad(arg1:double):double;
begin
    result  := sin(DegToRad(arg1));
end;

function cosrad(arg1:double):double;
begin
    result := cos(DegToRad(arg1));
end;


function cosecrad(arg1:double):double;
begin
    result  := 1/sin(DegToRad(arg1));
end;


function secrad(arg1:double):double;
begin
    result:= 1/cos(DegToRad(arg1));
end;


function blanc(arg1:double):double;
Var
   temp,res:extended;
   count:integer;
begin
  Begin
  res:=0;
   for count := 0 to 49 do
   begin
     arg1:=arg1-int(arg1-(Ord(arg1<0)));
     if (arg1)<0.5 then temp:=(arg1) else temp:=(1-arg1);
     res:=res+ temp/(power(2,count));
     arg1:=2*arg1;
   end;
  end;
  result:=res;
end;

function min(arg1,arg2:double):double;
begin
    if arg1 < arg2 then
      result  := arg1
    else
      result := arg2;
end;

function max(arg1,arg2:double):double;
begin
    if arg1 < arg2 then
      result  := arg2
    else
      result  := arg1;
end;

function heaviside(arg1:double):double;
begin
    if arg1 < 0 then
      result := 0
    else
      result  := 1;
end;

function sign(arg1:double):double;
begin
    if arg1 < 0 then
      result := -1
    else
      if arg1 > 0 then
        result := 1.0
      else
        result := 0.0;
end;

function zero(arg1:double):double;
begin
    if arg1 = 0.0 then
      result := 0.0
    else
      result:= 1.0;
end;


function ceil(arg1:double):double;
begin
    if frac(arg1) > 0 then
      result:= int(arg1 + 1)
    else
      result:= int(arg1);
end;

function floor(arg1:double):double;
begin
    if frac(arg1) < 0 then
      result:= int(arg1 - 1)
    else
      result:= int(arg1);
end;

 


function radius(arg1,arg2:double):double;
begin
    result:= sqrt(sqr(arg1)+sqr(arg2));
end;


上一篇:用Delphi開發(fā)報表打印的ASP組件

下一篇:Delphi常見圖象格式轉(zhuǎn)換技術(二)

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
學習交流
熱門圖片

新聞熱點

疑難解答

圖片精選

網(wǎng)友關注

主站蜘蛛池模板: 91精品国产综合久久婷婷香蕉 | chinesexxxx刘婷hd| 亚洲91精品 | 精品日韩欧美 | 欧美日韩在线视频观看 | 国产激情网 | 日韩伦理电影免费观看 | 久久99深爱久久99精品 | 欧美黄色片免费看 | 国产精品久久久久久久久久电影 | 久久精品视频网站 | 国产精品18久久久久久久久 | 视频一区二区三区在线播放 | 欧美一级片免费在线观看 | 黄色av片三级三级三级免费看 | 天天草夜夜爽 | 久久成人视屏 | 亚洲精品欧美二区三区中文字幕 | 欧美wwwsss9999| 欧美一级毛片免费观看 | 日本一区二区视频在线观看 | 日韩欧美电影一区二区三区 | 免费午夜网站 | 性欧美极品xxxx欧美一区二区 | 一级电影免费看 | 国产精品99一区二区 | 在线高清中文字幕 | 色就操| 99爱视频在线 | 一级全毛片 | 久久久久亚洲精品国产 | 欧美日韩在线免费观看 | 欧洲精品久久 | 一级毛片在线免费播放 | 怦然心动50免费完整版 | 午夜精品久久久久久久久久久久久蜜桃 | 精品av在线播放 | 毛片一区二区三区四区 | av中文在线观看 | 制服丝袜成人动漫 | 亚洲国产精品高潮呻吟久久 |