简体   繁体   English

如何计算PHP中的arcot(反余切)?

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

PHP has many builtin trig math functions, but the inverse cotangent does not seem to be available as one of them. PHP有许多内置的trig数学函数,但反向余切似乎不是其中之一。 This is also referred to as arccot. 这也称为arccot。 Does anyone have the function equivalent in PHP to compute this? 有没有人在PHP中具有相同的功能来计算它?

Do you have arctan in PHP? 你有PHP的arctan吗? Given x and you want to computer arccot(x) , you could compute arctan(1/x) since this equals arccot(x) . 给定x并且你想要计算机arccot(x) ,你可以计算arctan(1/x)因为它等于arccot(x)

You can use arctan(x) to calculate arccot(x) : 您可以使用arctan(x)来计算arccot(x)

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

尝试使用Math_Complex PEAR包来做到这一点: httpMath_Complex

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM