PHP Tips & Tutorials

PHP: Convert Radians to Degrees and Degrees to Radians

Radians and degrees are 2 different quantitative approaches to denote an angle, in PHP, you can convert a radian value to a degree by the function rad2reg() and a degree value to radian by the function deg2rad():

$degrees = rad2deg('3.1416'); // $degrees = 180
$radians = deg2rad(180); // $radians = 3.14159265359

By Yang Yang

Hello, I'm Yang. I build online businesses that please people. Want to join in and post some useful articles on Shoot me a message.