atan()


float atan ( float $arg )

Description

atan() returns the arc tangent of $arg in radians. atan() is the complementary function of the tan().

※ available F/W version : all

Parameters

Return values

Returns the arc tangent of $arg in radians

Example

<?php
$y = 1.0;$x = 2.0;
$y3 = -1.0;$x3 = -2.0;

$rad = $y/$x;
$val1 = atan($rad);
$val2 = atan2($y, $x);
$val3 = atan2($y3, $x3);
$val4 = tan($val1);

echo "atan($rad) = $val1\r\n";  // OUTPUT: atan(0.5) = 0.46364760900081
echo "atan2($y, $x) = $val2\r\n";  // OUTPUT: atan2(1, 2) = 0.46364760900081
echo "atan2($y3, $x3) = $val3\r\n";  // OUTPUT: atan2(-1, -2) = -2.677945044589
echo "tan($val1) = $val4\r\n";  // OUTPUT: tan(0.46364760900081) = 0.5
?>

See also

tan() / atan2()

Remarks

This function is identical to the PHP group’s atan() function.