- 0133技术站
- 联系QQ:18840023
- QQ交流群
- 微信公众号
hypot()方法返回其参数的平方和的平方根。
语法:
Math.hypot( x1,x2.. ) ;
参数:
● x1和x2 .. - 表示数字
返回值:
返回通过参数传递的所有数字平方之和的平方根,即:
例:
console.log("---Math.hypot()---") console.log("Math.hypot(3,4) : "+Math.hypot(3,4)) console.log("Math.hypot(2,3,4) : "+Math.hypot(2,3,4))
输出:
---Math.hypot()--- Math.hypot(3,4) : 5 Math.hypot(2,3,4) : 5.385164807134504
推荐手册