Javatpoint Logo
Javatpoint Logo

PHP hypot() Function

The hypot() function is mathematical PHP function. It is used to calculate the hypotenuse of a right-angle triangle. It returns the length of the hypotenuse of a right-angle triangle with sides of length x and y.

Syntax:

hypot() returns the length of the hypotenuse of a right-angle triangle with sides of length x and y.

Parameter Description Required/Optional
x Specify the length of first side required
y Specify the length of second side required

Example 1

Output:

Your Number is (3,4)
By using 'hypot()' Function your Value is 5

Example 2

Output:

Your Number is (4,6)
By using 'hypot()' Function your Value is 7.211102550928

Example 3

Output:

Your Number is (1,3)
By using 'hypot()' Function your Value is 3.1622776601684

Example 4

Output:

Your Number is (3*3+4*4) 
By using 'hypot()' Function your Value is 5

Next TopicPHP Math





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA