Degrees and Radians conversions

<?php
//degrees to radians function
function DegToRad($degrees)
{
return $degrees * 3.14 / 180;
}
//radians to degrees conversion
function RadToDeg($radians)
{
return $radians * 180 / 3.14;
}
?>

and here is our code to test these functions

<?php
//testing our functions with some values
echo DegToRad(90);
echo “<br>”;
echo RadToDeg(0.707);
?>

SHARE
Previous articleRandom image example
Next articleOdd or even function

LEAVE A REPLY

Please enter your comment!
Please enter your name here

*