Convert degrees to radians:
<?php
echo deg2rad("45") . "<br>";
echo deg2rad("90") . "<br>";
echo deg2rad("360");
?>
Try it Yourself »
The deg2rad() function converts a degree value to a radian value.
Tip: To convert a radian value to a degree value, look at the rad2deg() function.
deg2rad(
number);
Parameter | Description |
---|---|
number | Required. Specifies the degree to convert |
Return Value: | The radian equivalent of number |
---|---|
Return Type: | Float |
PHP Version: | 4+ |
Convert a degree into its radian equivalent:
<?php
$deg = 180;
$rad = deg2rad($deg);
echo "$deg degrees is equal to $rad radians.";
?>
Try it Yourself »
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!