PHP hypot() function Last Updated : 22 Jun, 2023 Comments Improve Suggest changes Like Article Like Report The hypot() function is a built-in mathematical function in PHP and returns the square root of sum of square of arguments passed. It finds the hypotenuse, hypotenuse is the longest side of a right angled triangle. It is calculated by the formula : h = \sqrt{x^2+y^2} where x and y are the other two sides of the triangle. Syntax: hypot(x,y); Parameters used: x : the length of first side. y: the length of the second side. Return Type: The return type of hypot(x,y) is Float and it returns the square root of squares of values passed to it as parameters. Examples: Input : x=3, y=4 Output :5 Input :x=9, y=10 Output : 13.453624047074 Below program illustrates the working of hypot() function in PHP: PHP <?php // PHP code // Calculating the value of hypotenuse // With sides = 3,4 $hypotenuse = hypot(3,4); print_r($hypotenuse); // New Line print_r("\n"); // Calculating the value of hypotenuse // With sides = 4,6 $hypotenuse = hypot(4,6); print_r($hypotenuse); ?> Output: 5 7.211102550928 Related Article: hypot() in C++ Comment More infoAdvertise with us Next Article PHP hypot() function S ShivamKD Follow Improve Article Tags : Misc Web Technologies PHP PHP-math PHP-function +1 More Practice Tags : Misc Similar Reads PHP octdec( ) Function In the earlier days of computing, octal numbers and the octal numbering system was very popular for counting inputs and outputs because as it works in counts of eight, inputs and outputs were in counts of eight, a byte at a time. Due to a wide usage of octal number system many times it happens that 2 min read PHP krsort() Function The krsort() function is an inbuilt function in PHP which is used to sort an array by key in reverse order according to its index values. It sorts in a way that relation between indices and values is maintained. Syntax: bool krsort( $array, $sorting_type ) Parameters: This function accepts two param 2 min read PHP list() Function The list() function is an inbuilt function in PHP which is used to assign array values to multiple variables at a time. This function will only work on numerical arrays. When the array is assigned to multiple values, then the first element in the array is assigned to the first variable, second to th 2 min read PHP | ip2long() Function The ip2long() function is an inbuilt function in PHP that converts IPv4 address (dotted IP address) into a long integer. Syntax:Â int ip2long( string $ip_address ) Parameters: This function accepts single parameter as mentioned above and described below:Â Â $ip_address: It is required parameter which 2 min read PHP Math Functions PHP is a scripting language that comes with many built-in math functions and constants. These tools help you do basic math, solve more complex problems, and work with different math concepts. This guide gives an overview of PHP's math functions and constants, along with examples, practical uses, and 5 min read Like