实例
把角度转换为弧度:
<?php 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."; ?>
