w3resource logo


PHP  deg2rad function

PHP deg2rad() function

<<PreviousNext>>

The deg2rad() function is used to convert a number in degrees to its radian (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

php math deg2rad() function

Example :

<?php
echo 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

PHP Function Reference

<<PreviousNext>>

Rate this tutorial


Your Rating: not set

Share this tutorial

RSS Feed