English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

deg function in PHP2rad() function

Returns2Text

The rad() function converts degrees to radian values. It returns the radian equivalent value of the specified degree value.

Returns2Syntax

rad(num)

  • Parameter-num

The degree value to be converted to radians.

Returns2The rad() function returns the radian equivalent value of the specified degree value.

Example

<?php
   $degVal = 360;
   $radVal = deg2rad($degVal);
   echo "$degVal degrees converted to $radVal radians!";
?>

Output Result

360 degrees converted to 6.2831853071796 radians!

Let's see another example-

Example

<?php
   echo deg2rad("45) . "<br>";
   echo deg2rad("90") . "<br>";
   echo deg2rad("180") . "<br>";
   echo deg2rad("270") . "<br>";
   echo deg2rad("360);
?>

Output Result

0.78539816339745<br>1.5707963267949<br>3.1415926535898<br>4.7123889803847<br>6.2831853071796