To take the arctangent of a number in PHP, you can use the atan()
function. This function takes a single argument, which is the number for which you want to find the arctangent. The result of the function is the arctangent of the input number in radians.
Here's an example usage of the atan()
function:
main.php123 chars7 lines
This will output:
main.php51 chars2 lines
Note that the atan()
function returns the result in radians. If you want the result in degrees, you can use the rad2deg()
function to convert the result:
main.php163 chars8 lines
This will output:
main.php78 chars2 lines
gistlibby LogSnag