De hypotenusa is de langste zijde van een rechthoekige driehoek. De functie hypot () wordt gebruikt om de hypotenusa te vinden als er twee andere zijden zijn.
hypot () functie Prototype
dubbele hypot (dubbele p, dubbele b);
h = √(p2+b2)
in wiskunde is gelijk aan h = hypot(p, b);
in C Programming.
De functie hypot () is gedefinieerd in "> math.h header-bestand.
Voorbeeld: C hypot () Functie
#include #include int main() ( double p, b; double hypotenuse; p = 5.0; b = 12.0; hypotenuse = hypot(p, b); printf("hypot(%.2lf, %.2lf) = %.2lf", p, b, hypotenuse); return 0; )
Uitvoer
hypot (5,00, 12,00) = 13,00