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.

Creative Commons License Except where otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License