rad2deg()

Published Jun 29, 2023
Contribute to Docs

The rad2deg() function in PHP converts radians to degrees. It accepts a number (radian value) as an input and returns the corresponding number in degrees.

Syntax

rad2deg(number);

Where number is the radian value to convert to degrees. The value returned by the function is a float type and is the equivalent of number in degrees.

Example

A basic example of the rad2deg() function:

<?php
echo rad2deg(1.71);
?>

This example results in the following output:

97.975782967371

Codebyte Example

The following example returns the degree value for 0.48 radians.

Code
Output
Loading...

All contributors

Looking to contribute?

Learn PHP on Codecademy