Computer >> Computer tutorials >  >> Programming >> PHP

rad2deg() function in PHP


The rad2deg() function converts radian value to degree value. It Returns the equivalent of radia value val in degrees.

Syntax

rad2deg(val)

Parameters

  • val − The radian value to be converted into degree.

Return

The rad2deg() function Returns the equivalent of val in degrees.

Example

<?php
   echo rad2deg(pi());
?>

Output

180

Example

Let us see another example −

<?php
   echo rad2deg(pi()/2);
?>

Output

90

Example

Let us see another example −

<?php
   echo rad2deg(pi()/8);
?>

Output

22.5