Never use deg2rad() in loops, use $rad = ($deg * M_PI / 180) instead which is faster!
(PHP 4, PHP 5, PHP 7)
deg2rad — 将角度转换为弧度
$number
)
本函数把 number
从角度转换成弧度。
number
以角度为单位的值
number
等量的弧度值
Example #1 deg2rad() 例子
<?php
echo deg2rad(45); // 0.785398163397
var_dump(deg2rad(45) === M_PI_4); // bool(true)
?>
Never use deg2rad() in loops, use $rad = ($deg * M_PI / 180) instead which is faster!