Python hypot() 函数

描述

hypot() 返回欧几里德范数 sqrt(xx + yy)。

hypot() 方法的语法:

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.605551275463989
hypot(-3, 3) :  4.242640687119285
hypot(0, 2) :  2.0

你可能感兴趣的:(Python hypot() 函数)