PHPRO.ORG

This function is provided to is companion function found at http://phpro.org/examples/Degrees-To-Radians.php. Handy for use in geo targetting or geo location or any geographical application you can think.

This function is already available within PHP itself using rad2deg() and is shown here for example only.


<?php

/*
 *
 * @convert radians to degrees
 *
 * @param float $radians
 *
 * @return float
 *
 */
 
function radiansToDegrees($radians)
 {
    return 
$radians 180 pi();
 }

 
/*** example usage ***/
 
$radians 0.123;

 echo 
radiansToDegrees($radians);

?>