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: http://php.net/manual/en/function.atan2.php Comment More infoAdvertise with us Next Article PHP atan2( ) Function S Shubrodeep Banerjee Follow Improve Article Tags : Misc Web Technologies PHP PHP-math PHP-function +1 More Practice Tags : Misc Similar Reads PHP atan( ) Function Trigonometry is an important part of mathematics and PHPâs math functions provides us with some functions which are very useful for calculations involving trigonometry. One of such function is atan() function. The atan() function in PHP is used to find the arc tangent of an argument passed to it whi 2 min read PHP asin( ) Function Trigonometry is an important part of mathematics and PHPâs math functions provides us with some functions which are very useful for calculations involving trigonometry. One of such function is asin() function. The asin() function in PHP is used to find the arc sine of a number in radians. We already 2 min read PHP array() Function The array() function is an inbuilt function in PHP which is used to create an array. There are three types of array in PHP: Indexed array: The array which contains numeric index. Syntax: array( val1, val2, val3, ... ) Associative array: The array which contains name as keys. Syntax: array( key=>v 2 min read PHP | fstat( ) Function The fstat() function in PHP is an inbuilt function which is used to return information about an open file. The file name is sent as a parameter to the fstat() function and it returns an array with the following elements : Numeric Associative Description 0 dev Device number 1 ino inode number* 2 mode 3 min read PHP end() Function The end() function is an inbuilt function in PHP and is used to find the last element of the given array. The end() function changes the internal pointer of an array to point to the last element and returns the value of the last element.Syntax:end($array)Parameters:This function accepts a single par 2 min read PHP Array Functions Arrays are one of the fundamental data structures in PHP. They are widely used to store multiple values in a single variable and can store different types of data, such as strings, integers, and even other arrays. PHP offers a large set of built-in functions to perform various operations on arrays. 7 min read PHP fscanf() Function The fscanf() function is an inbuilt function in PHP that parses the file's input according to format, i.e., it accepts the input from a file that is associated with the stream & the input will be interpreted according to the specified format. This function is similar to sscanf() function. Any wh 2 min read PHP | exit( ) Function The exit() function in PHP is an inbuilt function which is used to output a message and terminate the current script. The exit() function only terminates the execution of the script. The shutdown functions and object destructors will always be executed even if exit() function is called. The message 2 min read PHP eval() Function PHP eval() function in PHP is an inbuilt function that evaluates a string as PHP code. Syntax: eval( $string ) Parameters: This function accepts a single parameter as shown in the above syntax and described below. $string: It must consist of a valid PHP code to be evaluated but should not contain op 2 min read PHP each() Function The each() function is an inbuilt function in PHP and is used to get the current element key-value pair of the given array to which the internal pointer is currently pointing. After returning the key and value of the current element the internal pointer is incremented by one in the array. Note: You 2 min read Like