Most programming interfaces that deal with angles talk in radians (2 pi radians in a circle), likeCGAffineTransformRotate
. I personally think better in degrees (360 degrees in a circle).Convert degrees to radians by multiplying by
180 / pi
.Convert radians to degrees by multiplying by
pi / 180
I have a couple of #defines I stick into a common header for projects that need it;
#define BWDegToRad(d) ((d) * M_PI / 180.0) #define BWRadToDeg(r) ((r) * 180 / M_PI)