PHP atan2( ) Function Last Updated : 22 Jun, 2023 Comments Improve Suggest changes Like Article Like Report The atan2() function is a builtin function in PHP and is used to calculate the arc tangent of two variables x and y passed to it as arguments. The function returns the result in radians, which is between -Pi and Pi (inclusive). Syntax: float atan2($y, $x) Parameters: This function accepts two parameters and are described below: $y: This parameter specifies the dividend. $x: This parameter specifies the divisor. Return Value: It returns a float value which is the arc tangent of y/x in radians. Examples: Input : atan2(0.50, 0.50) Output : 0.78539816339745 Input : atan2(-0.50, -0.50) Output : -2.3561944901923 Input : atan2(5, 5) Output : 0.78539816339745 Input : atan2(10, 20) Output : 0.46364760900081 Below programs, taking different values of the parameters are used to illustrate the atan2() function in PHP: When (0.50, 0.50) is passed as a parameter: PHP <?php echo (atan2(0.50, 0.50)); ?> Output: 0.78539816339745 When (-0.50, -0.50) is passed as a parameter: PHP <?php echo (atan2(-0.50, -0.50)); ?> Output: -2.3561944901923 When (5, 5) is passed as a parameter: PHP <?php echo (atan2(5, 5)); ?> Output: 0.78539816339745 When (10, 20) is passed as a parameter: PHP <?php echo (atan2(10, 20)); ?> Output: 0.46364760900081 Reference: https://www.php.net/manual/en/function.atan2.php Create Quiz Comment S Shubrodeep Banerjee Follow 0 Improve S Shubrodeep Banerjee Follow 0 Improve Article Tags : Misc Web Technologies PHP PHP-math PHP-function +1 More Explore BasicsPHP Syntax4 min readPHP Variables5 min readPHP | Functions6 min readPHP Loops4 min readArrayPHP Arrays5 min readPHP Associative Arrays4 min readMultidimensional arrays in PHP5 min readSorting Arrays in PHP4 min readOOPs & InterfacesPHP Classes2 min readPHP | Constructors and Destructors5 min readPHP Access Modifiers4 min readMultiple Inheritance in PHP4 min readMySQL DatabasePHP | MySQL Database Introduction4 min readPHP Database connection2 min readPHP | MySQL ( Creating Database )3 min readPHP | MySQL ( Creating Table )3 min readPHP AdvancePHP Superglobals6 min readPHP | Regular Expressions12 min readPHP Form Handling4 min readPHP File Handling4 min readPHP | Uploading File3 min readPHP Cookies9 min readPHP | Sessions7 min read Like