To take the arccosine of a number in PHP, you can use the built-in acos()
function. This function returns the arccosine of a number, in radians.
Here's an example:
main.php96 chars6 lines
In this example, we pass the number 0.5
to the acos()
function, which returns its arccosine in radians.
Note that the input to the acos()
function should be between -1 and 1. If the input is outside this range, the function will return NaN
(Not a Number).
gistlibby LogSnag