PHP: Convert Radians to Degrees and Degrees to Radians

by Yang Yang on June 3, 2009

Share This Article:
Subscribe to Kavoir: blog feed

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
Share This Article:
Subscribe to Kavoir: blog feed

You should also read:

Leave a Comment

Previous post:

Next post: