Math. hypot() 函式
Math 物件的 hypot() 函式可以接受數字,然後返回給定數字的平方的和的平方根。
語法
其語法如下
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
廣告