Computer >> Computer tutorials >  >> Programming >> PHP

atan() function in PHP


The atan() function return the arc tangent of a number. It returns a float, which is a numeric value between -Pi/2 and Pi/2 radians.

Syntax

atan(val)

Parameters

  • val − The value for which you want to get the arc tangent.

Return

The atan() function returns the arc tangent of a number.

Example

<?php
   echo(atan(20) . "<br>");
   echo(atan(2) . "<br>");
   echo(atan(0.60) . "<br>");
   echo(atan(-0.60) . "<br>");
?>

Output

1.520837931073<br>1.1071487177941<br>0.54041950027058<br>-0.54041950027058<br>