Degrees to Radians

Started by
2 comments, last by Raeldor 18 years, 10 months ago
Math has never been my strong point, but am I correct in saying the formula to convert from degrees to radians is... (degrees/180.0f)*D3DX_PI IE, to go from 0 to +1 to 0 to -1 to 0 when using SIN or COS you need to go from 0 to PI*2? Thanks Ray
Advertisement
you might have known that 360 degrees is 2PI...just checkout with 360 degrees and u'll find the above math is right...as simple as that !!

.kavitha
or..
radians = degrees * (D3DX_PI/180.0f)

I prefer this method, because you can pre-compute the D3DX_PI/180.0f value and save it in a constant, this'll save you a floating-point divide whenever you want to do the conversion.
Quote:Original post by pragma Fury
or..
radians = degrees * (D3DX_PI/180.0f)

I prefer this method, because you can pre-compute the D3DX_PI/180.0f value and save it in a constant, this'll save you a floating-point divide whenever you want to do the conversion.


Ah, now that looks more readable!

This topic is closed to new replies.

Advertisement