Home >>PHP Math Functions >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 | 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>
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>