简体   繁体   中英

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. This is also referred to as arccot. Does anyone have the function equivalent in PHP to compute this?

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) .

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

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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