I run into this occasionally and always forget how to do it.
One of those things that pop up ever so often.
Also, what's the formula to convert angles expressed in radians to degrees and back again?
-
180 degrees = PI * radians
thesmallprint : No, 180 degrees = Pi.From Charles Graham -
x rads in degrees - > x*180/pi
x degrees in rads -> x*pi/180I guess if you wanted to make a function for this [in PHP]:
function convert($type, $num) { if ($type == "rads") { $result = $num*180/pi(); } if ($type == "degs") { $result = $num*pi()/180; } return $result; }
Yes, that could probably be written better.
From thesmallprint -
radians = pi * (degrees/180)
As for implementation, the main question is how precise you want to be about the value of pi. There is some related discussion here
From Dave Costa -
360 degrees is 2*PI radians
You can find the conversion formulas at: http://en.wikipedia.org/wiki/Radian#Conversion_between_radians_and_degrees.
From kokos -
360 degrees = 2*pi radians
That means deg2rad(x) = x*pi/180 and rad2deg(x) = 180x/pi;
From kigurai -
a complete circle in radians is 2*pi. A complete circle in degrees is 360. To go from degrees to radians, it's (d/360) * 2*pi, or d*pi/180.
From nsayer -
pi Radians = 180 degrees
So 1 degree = pi/180 radians
or 1 radian = 180/pi degrees
From manobes -
radians = (degrees/360) * 2 * pi
From Axeman -
I prefer to use the Google Calculator. http://www.google.com/search?q=6+radians+in+degrees&sourceid=navclient-ff&ie=UTF-8&rlz=1B3GGGL_enUS235US236&aq=t
All you have to do is type it into google and it gives you the answer. "6 radians in degrees" searched in google will give you this result.
6 radians = 343.774677 degrees
nsayer : I thinking adding a web service call to your code to have google convert radians to degrees for you is, perhaps, overkill.From Brendan Enrick
0 comments:
Post a Comment