Definition
<?
function rad2deg($arg) {
return $arg*180/pi();
}
?>
(PHP 4, PHP 5, PHP 7, PHP 8)
rad2deg — Converts the radian number to the equivalent number in degrees
num
A radian value
The equivalent of num
in degrees
Example #1 rad2deg() example
<?php
echo rad2deg(M_PI_4); // 45
?>
Conversion between grads and degrees
function gon2deg($gon) {
return ($gon / 400) * 360;
}
function deg2gon($deg) {
return ($deg / 360) * 400;
}