Why radians are used everywhere in programming?
Yesterday I found myself not remembering an answer to why radians are universally used to represent angles. I had forgotten this:
The radians represent angles as arc lengths that the angles correspond to on an circle of radius=1. 2π is the circumference of such circle, that is also the angle representing the full circle in radians.
The precence of 2π in radians as full circle makes it unnecessary to measure angles in degrees. Instead you can represent common angles as fractions of π. π/2 rad is 90 degrees. π/3 rad is 60 degrees. π/5 rad is 36 degrees. π/7 rad is ~25.714 degrees. See it allows you to tune your measurement of angles to fit what you're working on.
If you're rolling a cylinder of radius 25 meters for 5 radians over a flat surface, how far did the cylinder move? a*r = 25*5 = 125
meters is the answer. Consider what the above question would be if you had measured 5 degrees instead of radians: 5π/180*25
. There, you have to calculate the arc length, so you're going through radians anyway.
If you're measuring the tangent on a circle, and a point on the circle closing on that tangent, given the angle difference between the tangent and the point as a
, the tan(a) - sin(a)
approaches zero.
Independent of whatever you're working with, radians as angle measure seem to make everything easier, because it produces additional relationships with things, that would not appear with other angle measures.