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 S ShivamKD Follow 0 Improve S ShivamKD Follow 0 Improve Article Tags : Misc Web Technologies PHP PHP-math PHP-function +1 More Explore PHP Tutorial 8 min read BasicsPHP Syntax 4 min read PHP Variables 5 min read PHP | Functions 8 min read PHP Loops 4 min read ArrayPHP Arrays 5 min read PHP Associative Arrays 4 min read Multidimensional arrays in PHP 5 min read Sorting Arrays in PHP 4 min read OOPs & InterfacesPHP Classes 2 min read PHP | Constructors and Destructors 5 min read PHP Access Modifiers 4 min read Multiple Inheritance in PHP 4 min read MySQL DatabasePHP | MySQL Database Introduction 4 min read PHP Database connection 2 min read PHP | MySQL ( Creating Database ) 3 min read PHP | MySQL ( Creating Table ) 3 min read PHP AdvancePHP Superglobals 6 min read PHP | Regular Expressions 12 min read PHP Form Handling 4 min read PHP File Handling 4 min read PHP | Uploading File 3 min read PHP Cookies 9 min read PHP | Sessions 7 min read Like