hypot

 
 
 

Returns the magnitude of two-dimensional vector from the origin to a point with coordinates X, Y.

As shown in the preceding figure, the hypot function returns the radius of a circle whose center is at one end of a right triangle’s hypotenuse and perimeter is at the other end of the hypotenuse.

The following equation gives the magnitude of the vector:

float hypot(float x, float y)

X is the X coordinate of the point.

Y is the Y coordinate of the point.

Example

hypot(3,4)

Returns 5.