Never use deg2rad() in loops, use $rad = ($deg * M_PI / 180) instead which is faster!
PHP - Manual: deg2rad
2024-12-23
(PHP 4, PHP 5, PHP 7, PHP 8)
deg2rad — 将角度转换为弧度
$number
): float
本函数把 number
从角度转换成弧度。
number
以角度为单位的值
number
等量的弧度值
示例 #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!