HipotC () - Biblioteca Padrão C

A hipotenusa é o lado mais longo de um triângulo retângulo. A função hypot () é usada para encontrar a hipotenusa quando outros dois lados são fornecidos.

protótipo da função hypot ()

 hipoteca dupla (duplo p, duplo b);

h = √(p2+b2)em matemática é equivalente a h = hypot(p, b);em C Programming.

A função hypot () é definida no arquivo de cabeçalho "> math.h.

Exemplo: Função C hypot ()

 #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; )

Resultado

 hipot (5,00, 12,00) = 13,00

Artigos interessantes...