Home >>PHP Math Functions >PHP atan() Function

PHP atan() Function

PHP atan() Function

PHP atan() function is used to find the arc tangent of the given input value passed to it as a parameter having a numeric value between -Pi/2 and Pi/2 radians. It is the complementary function of tan(). It accepts only a single parameter $number which is the number whose arc tangent value is to be found. It returns a floating point number as output which is the arc tangent value of the input number passed to it as argument.

Syntax:

  atan($number);

Parameter Values

Parameter Description
number This is a required parameter. This parameter defines the input value to process.

Here is an example of atan() function in PHP:

<html>
<body>

<?php

echo atan(10)."<br>";
echo atan(-10)."<br>";
echo atan(0.69)."<br>";
echo atan(-0.69)."<br>";

?>

</body>
</html>
Output:
1.4711276743037
-1.4711276743037
0.603982978253
-0.603982978253

Here is an another example of atan() function in PHP:

<html>
<body>

<?php

echo atan(0)."<br>";
echo atan(180)."<br>";  //return value would be between -pi/2 to pi/2 
echo atan(90)."<br>";
echo atan(-90)."<br>";

?>

</body>
</html>
Output:
0
1.5652408283942
1.5596856728973
-1.5596856728973

No Sidebar ads