PHP atan() Function

Definition

The atan() function calculates the arc tangent value. It reverses the operation of tan().

Syntax

PHP atan() Function has the following format.

float atan ( float num )

Parameter

ParameterDescription
numRequired. Specifies an argument to process

Return

The arc tangent of arg in radians.

We can use the rad2deg() to convert radians to degrees.

Example

Return the arc tangent of different numbers with the atan() function:


<?php/*from  ww  w  . ja v a2  s.c  o m*/
$atan1 = atan(0.46); 
echo $atan1;
$atan2 = atan(tan(80)); 
echo $atan2;

echo(atan(0.5) . "\n");
echo(atan(-0.5) . "\n");
echo(atan(5) . "\n");
echo(atan(-5) . "\n");
echo(atan(100) . "\n");
echo(atan(-100));
?>

The code above generates the following result.





















Home »
  PHP Tutorial »
    Function reference »




PHP Array Functions
PHP Calendar Functions
PHP Class Functions
PHP Data Type Functions
PHP Date Functions
PHP File Functions
PHP Image Functions
PHP Math Functions
PHP MySQLi Functions
PHP SimpleXML Functions
PHP String Functions
PHP XML Functions
PHP Zip Functions