PHP rad2deg()

alexflightlessbird's avatar
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.

  • Looking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!
    • Includes 6 Courses
    • With Professional Certification
    • Beginner Friendly.
      75 hours

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

All contributors

Contribute to Docs

Learn PHP on Codecademy

  • Looking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!
    • Includes 6 Courses
    • With Professional Certification
    • Beginner Friendly.
      75 hours