PHP Tutorial PHP Advanced PHP Resources
Python Java C++ C C# PHP R SQL DS Algo InterviewQ

PHP - Math atan() Function



The PHP Math atan() function returns arc tangent of a value. The return value will be in the range -𝜋/2 through 𝜋/2.

Note: atan() is the inverse of tan().

Syntax

atan(number)

Parameters

number Required. Specify the value.

Return Value

Returns the arc tangent of the value.

Example:

In the example below, atan() function is used to find out the arc tangent of a given value.

<?php
echo atan(0.5)."\n";
echo atan(1)."\n";
echo atan(2)."\n";
?>

The output of the above code will be:

0.46364760900081
0.78539816339745
1.1071487177941

❮ PHP Math Functions

5