hypot(x, y)
x -- 這必須是一個數值
y -- 這必須是一個數值
hypot() 方法返回歐幾里得範數, sqrt(x*x + y*y).
#!/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))
hypot(3, 2) : 3.60555127546 hypot(-3, 3) : 4.24264068712 hypot(0, 2) : 2.0