Never use deg2rad() in loops, use $rad = ($deg * M_PI / 180) instead which is faster!
(PHP 4, PHP 5, PHP 7, PHP 8)
deg2rad — 将角度转换为弧度
num
以角度为单位的值
num
等量的弧度值
示例 #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!