Table of Contents

Syntax

float atan2(float $y, float $x)

(PHP 4, PHP 5)

$y Numerator of a fraction (y / x) which is the argument for the arc tangent.
$x Numerator of a fraction (y / x) which is the argument for the arc tangent.
RETURNS The arc tangent of the fraction ($y / $x). This result will be between -PI and PI.

What it Does

This function computes the arc tangent for the arguments $y and $x which represent the numerator and denominator of the fraction (y / x). The result of this trigonometry function is a value between -PI and PI where PI is roughly (3.14.15926).

Example

// compute the inverse hyperbolic sine for 1.4 radians
echo 'atan2(1.4, 2.0) = ' . atan2(1.4, 2.0);
 
atan2.txt · Last modified: Apr 18, 2008 - 2:00pm (external edit)
 
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki