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)
.
Try using Math_Complex
PEAR package to do that: http://pear.php.net/manual/en/package.math.math-complex.math-complexop.acot.php
You can use arctan(x) to calculate arccot(x):
function acot(x) {
return pi()/2 - atan(x);
}