PHP deg2rad() 函数
PHP 教程
· 2019-01-26 21:13:58
实例
把角度转换为弧度:
<?php
echo deg2rad("45") . "<br>";
echo deg2rad("90") . "<br>";
echo deg2rad("360");
?>
echo deg2rad("45") . "<br>";
echo deg2rad("90") . "<br>";
echo deg2rad("360");
?>
定义和用法
deg2rad() 函数把角度值转换为弧度值。
提示:如需把弧度值转换为角度值,请查看 rad2deg() 函数。
语法
deg2rad(number);
| 参数 | 描述 |
|---|---|
| number | 必需。规定要转换的角度。 |
技术细节
| 返回值: | number 对应的弧度。 |
|---|---|
| 返回类型: | Float |
| PHP 版本: | 4+ |
更多实例
实例 1
把角度转换为它对应的弧度:
<?php
$deg = 180;
$rad = deg2rad($deg);
echo "$deg degrees is equal to $rad radians.";
?>
$deg = 180;
$rad = deg2rad($deg);
echo "$deg degrees is equal to $rad radians.";
?>
点击查看所有 PHP 教程 文章: https://codercto.com/courses/l/5.html
Learn Python the Hard Way
Zed Shaw / Example Product Manufacturer / 2011
This is a very beginner book for people who want to learn to code. If you can already code then the book will probably drive you insane. It's intended for people who have no coding chops to build up t......一起来看看 《Learn Python the Hard Way》 这本书的介绍吧!