• Advertisement
Sign in to follow this  

Degrees to Radians

This topic is 4618 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement