hypot(3C)
_________________________________________________________________
hypot function
Determine the hypotenuse of a right triangle.
_________________________________________________________________
Calling Sequence
#include <math.h>
double hypot(), x, y, z;
z = hypot(x, y);
Description
Use the hypot function to find the hypotenuse value z, where
z = sqrt( x * x + y * y )
Returns
The hypot function returns the value z, as described above.
Related Functions
See also the other arithmetic functions: sin(3c), cos(3c),
tan(3c), sqrt(3c).
Example
/* Program test for the hypot() function */
#include <stdio.h>
#include <math.h>
double atof(), x, y, z, hypot();
main(argc, argv)
int argc;
char *argv[];
{
x = atof(argv[1]);
y = atof(argv[2]);
printf("Hypotenuse = %f.\n", z = hypot(x, y));
}
A call to the program test with the numbers 3.3 and 4.4
DG/UX 4.00 Page 1
Licensed material--property of copyright holder(s)
hypot(3C)
Hypotenuse = 5.500000.
DG/UX 4.00 Page 2
Licensed material--property of copyright holder(s)