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 PHP | lstat( ) function The lstat() function in PHP is used to return information about a file or a symbolic link. It gathers statistics of the file which is sent as a parameter to the lstat() function. The function returns an array which includes information on following elements :Â Â [0] or [dev] - Device number[1] or [in 4 min read PHP | idate() Function The idate() function is an inbuilt function in PHP which is used to format a local time/date as an integer. The $format and $timestamp are sent as parameters to the idate() function and it returns an integer formatted according to the specified format using the given timestamp. Unlike the function d 2 min read PHP log1p() Function The log1p() is an inbuilt PHP function that returns log(1+number), & when the value of the number is close to zero, then it will compute the way that will provide the accurate result. Syntax: log1p(float $num): floatParameter: This function accepts only a single parameter: num: This parameter sp 1 min read PHP | mktime() Function The mktime() function is an inbuilt function in PHP which is used to return the Unix timestamp for a date. The timestamp returns a long integer containing the number of seconds between the Unix Epoch (January 1, 1970, 00:00:00 GMT) and the time specified. The hour, minute, second, month, day and yea 2 min read PHP min( ) Function The min() function of PHP is used to find the lowest value in an array, or the lowest value of several specified values. The min() function can take an array or several numbers as an argument and return the numerically minimum value among the passed parameters. The return type is not fixed, it can b 2 min read Like