rad2deg()
rad2deg() — Converts the radian number to the equivalent number in degrees.
Built-in function of PHP 8.5. The manual lists it as available in PHP 4, PHP 5, PHP 7, PHP 8. This page is the reference card: signature, parameters and return value, plus the changelog and the example the manual provides.
Signature
rad2deg(float $num): float
Parameters
| Parameter | Type | What it takes |
|---|---|---|
| $num | float | A radian value |
Return value
The equivalent of num in degrees
Example
A runnable snippet:
echo rad2deg(M_PI_4); // 45
See also
All PHP 8.5 built-in functions
Reference card built from the PHP manual page rad2deg() (PHP documentation, CC BY 3.0). The page is generated from the manual, so the wording of the parameter and return value text follows php.net.