数学。JavaScript中的hypot()函数
hypot()Math对象的函数接受数字,并返回给定数字平方和的平方根。
语法
它的语法如下
Math.hypot(12, 58, 66);
示例
<html>
<head>
<title>JavaScript Example</title>
</head>
<body>
<script type="text/javascript">
var result = Math.hypot(12, 58, 66);
document.write("hypot value: "+result);
</script>
</body>
</html>输出结果
hypot value: 88.67919710958147