PHP deg2rad() function
Description
The deg2rad() function is used to convert a number in degrees to its radian (the standard unit of angular measure, used in many areas of mathematics) equivalent.
Version:
(PHP 4 and above)
Syntax:
deg2rad (num)
Parameter:
Name | Description | Required / Optional |
Type |
---|---|---|---|
num | Angular value in degree. | Required | Float |
Return value:
The radian equivalent of num.
Value Type: Float.
Pictorial Presentation
Example:
<?phpecho deg2rad("45") .
'<br>';echo deg2rad("20") .
'<br>';echo deg2rad("90") .
'<br>';?>
Output :
0.78539816339745 0.34906585039887 1.5707963267949
View the example in the browser
See also
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics