degree to radiant

Started by
1 comment, last by SiCrane 15 years, 3 months ago
hy. there is a function in directx that convert degree to radiant? thanks.
Advertisement
Simply do this:
rad = degree * (M_PI / 180.0);

where M_PI can be taken from the cmath library, included after using
#define _USE_MATH_DEFINES

or can be defined manually.
The logic behind it: PI rad = 180 degrees.
There's a D3DX macro D3DXToRadian() in D3dx9math.h.

This topic is closed to new replies.

Advertisement