Die Hypotenuse ist die längste Seite eines rechtwinkligen Dreiecks. Die Funktion hypot () wird verwendet, um Hypotenuse zu finden, wenn zwei andere Seiten bereitgestellt werden.
hypot () Funktion Prototyp
Doppelhypot (Doppelp, Doppelb);
h = √(p2+b2)
in der Mathematik entspricht der h = hypot(p, b);
in der C-Programmierung.
Die Funktion hypot () ist in der Header-Datei "> math.h" definiert.
Beispiel: C hypot () Funktion
#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; )
Ausgabe
Hypot (5.00, 12.00) = 13.00