w3resource

PHP : atan() function

Description

The atan() function returns the arc tangent of a number as a numeric value in radians.

Version:

(PHP 4 and above)

Syntax:

atan( number )

Parameter:

Name Description Required /
Optional
Type
number Numeric value. Required Float

Return value:

The arc tangent of a number.

Value Type: Float.

Pictorial Presentation:

php math atan() function

Example:

<?php
$val1= 0;
$val2=.4;
$zatan1=atan($val1);
$zatan2=atan($val2);
echo "Arc tangent of $val1 is $zatan1<br />";
echo "Arc tangent of $val2 is $zatan2<br />";
?>

Output:

Arc tangent of 0 is 0
Arc tangent of 0.4 is 0.380506377112

View the example in the browser

See also

PHP Function Reference

Previous: atan2
Next: atanh



Follow us on Facebook and Twitter for latest update.