PHP hypot() 函数
PHP 教程
· 2019-01-26 22:58:07
实例
计算不同的直角三角形的斜边长度:
<?php
echo hypot(3,4) . "<br>";
echo hypot(4,6) . "<br>";
echo hypot(1,3) . "<br>";
echo sqrt(3*3+4*4);
?>
echo hypot(3,4) . "<br>";
echo hypot(4,6) . "<br>";
echo hypot(1,3) . "<br>";
echo sqrt(3*3+4*4);
?>
定义和用法
hypot() 函数计算直角三角形的斜边长度。
提示:该函数等同于 sqrt(x*x + y*y)。
语法
hypot(x,y);
| 参数 | 描述 |
|---|---|
| x | 必需。规定第一条直角边的长度。 |
| y | 必需。规定第二条直角边的长度。 |
技术细节
| 返回值: | 斜边的长度。 |
|---|---|
| 返回类型: | Float |
| PHP 版本: | 4.1+ |
点击查看所有 PHP 教程 文章: https://codercto.com/courses/l/5.html
Pro Django
Marty Alchin / Apress / 2008-11-24 / USD 49.99
Django is the leading Python web application development framework. Learn how to leverage the Django web framework to its full potential in this advanced tutorial and reference. Endorsed by Django, Pr......一起来看看 《Pro Django》 这本书的介绍吧!