How to use deg2rad in PHP

This article describe about deg2rad() Function in PHP.
  • 1304

deg2rad() Function

For convert degree to its radian number use deg2rad() function.

Syntax

deg2rad(degree_number)

 

Parameter Description
degree_number define the degree to convert

Example 1

<html>
<body>
<?php
echo deg2rad("60") . "<br />";
echo deg2rad("20") . "<br />";
echo deg2rad("399") . "<br />";
echo deg2rad("55");
?>
</body>
</html>

 

Output


deg2redphp1.jpg


Example 2

 

<html>
<body>
<?php
$deg = 360;
$rad = deg2rad($deg);
echo "$deg degrees is equal to $rad radians";
?>
</body>
</html>

 

Output


deg2redphp2.jpg

You may also want to read these related articles Click here

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.