X
HOME HTML5 CSS3 JAVASCRIPT SQL PHP5 JQUERY ANGULAR BOOTSTRAP3 XML MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

PHP atan2() Function

PHP Math Reference PHP Math Reference

Example

Return the arc tangent of two variables with the atan2() function:

<?php
echo(atan2(0.50,0.50) . "<br>");
echo(atan2(-0.50,-0.50) . "<br>");
echo(atan2(5,5) . "<br>");
echo(atan2(10,20) . "<br>");
echo(atan2(-5,-5) . "<br>");
echo(atan2(-10,10));
?>

Run example »

Definition and Usage

The atan2() function returns the arc tangent of two variables x and y.


Syntax

atan2(y,x);

Parameter Description
y Required. Specifies the dividend
x Required. Specifies the divisor

Technical Details

Return Value: The arc tangent of y/x in radians, which is between -Pi and Pi
Return Type: Float
PHP Version: 4+


PHP Math Reference PHP Math Reference

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE

facebook