开发者

How do I compute the arcot (inverse cotangent) in PHP?

PHP has many builtin trig math functions, but 开发者_如何学Pythonthe inverse cotangent does not seem to be available as one of them. This is also referred to as arccot. Does anyone have the function equivalent in PHP to compute this?


You can use arctan(x) to calculate arccot(x):

function acot(x) {
  return pi()/2 - atan(x);
}


Do you have arctan in PHP? Given x and you want to computer arccot(x), you could compute arctan(1/x) since this equals arccot(x).


Try using Math_Complex PEAR package to do that: http://pear.php.net/manual/en/package.math.math-complex.math-complexop.acot.php

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜