Home >>PHP Math Functions >PHP deg2rad() Function
PHP deg2rad() function is used to convert the given input degree value to an equivalent radian value. It takes only a single parameters $number which is the float value that represents the angle in degrees. It returns a float value that represents the radian equivalent of the given input angle as argument.
Syntax:
deg2rad($number);
Parameter | Description |
---|---|
number | This is a required parameter. This parameter defines the degree to convert. |
Here is an example of deg2rad() function in PHP:
<html> <body> <?php echo deg2rad("30")."<br>"; echo deg2rad("70")."<br>"; ?> </body> </html>
Here is an another example of deg2rad() function in PHP:
<html> <body> <?php echo deg2rad("0")."<br>"; echo deg2rad("45")."<br>"; echo deg2rad("90")."<br>"; echo deg2rad("180")."<br>"; echo deg2rad("360")."<br>"; ?> </body> </html>