The atan()
function calculates the arc tangent value.
It reverses the operation of tan()
.
PHP atan() Function has the following format.
float atan ( float num )
Parameter | Description |
---|---|
num | Required. Specifies an argument to process |
The arc tangent of arg in radians.
We can use the rad2deg()
to convert radians to degrees.
Return the arc tangent of different numbers with the atan() function:
<?php/*w ww . j a va2 s . c o m*/
$atan1 = atan(0.46);
echo $atan1;
$atan2 = atan(tan(80));
echo $atan2;
echo(atan(0.5) . "\n");
echo(atan(-0.5) . "\n");
echo(atan(5) . "\n");
echo(atan(-5) . "\n");
echo(atan(100) . "\n");
echo(atan(-100));
?>
The code above generates the following result.