función hypot python3 ()
descripción
hypot () Devuelve la raíz cuadrada norma euclidiana (x * x + y * y).
gramática
El siguiente es el método hypot sintaxis ():
import math math.hypot(x, y)
Nota: hypot () no es directamente accesible, debe importar el módulo de matemáticas, y luego llamar al método por objetos estáticos matemáticas.
parámetros
- x - un valor.
- y - un valor.
Valor de retorno
Volver sqrt norma euclidiana (x * x + y * y).
Ejemplos
A continuación se muestra un ejemplo del uso método hypot ():
#!/usr/bin/python3 import math print ("hypot(3, 2) : ", math.hypot(3, 2)) print ("hypot(-3, 3) : ", math.hypot(-3, 3)) print ("hypot(0, 2) : ", math.hypot(0, 2))
Después de ejecutar la salida anterior ejemplo es:
hypot(3, 2) : 3.605551275463989 hypot(-3, 3) : 4.242640687119285 hypot(0, 2) : 2.0