#### Archived

This topic is now archived and is closed to further replies.

# Converting MSVC++ from radians to degrees

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

## Recommended Posts

Hey, It seems as though MSVC++ works in radians rather than degrees. I know i can get around it by using DegToRadian functions and stuff but i'll lose accuracy in my calculations that way. Is there any way to set MSVC++ to read it in degrees instead? 'Very funny, Scotty. Now beam down my clothes.' - Edited by - TheBlackJester on January 13, 2002 1:59:16 AM

##### Share on other sites
You post has nuked this thread (I''m not sure what''s wrong). However: When does MSVC ask for degrees or radians? The math libraries aren''t part of MSVC if that''s what you mean. Maybe there''s something I''ve missed in MSVC...

[Resist Windows XP''s Invasive Production Activation Technology!]

##### Share on other sites
Sorry about the nuke, it was my sig that i messed up.

Yeah, i guess your right about it being in the math files so theres really no way to change it

##### Share on other sites
Use a preprocessor macro (#define) to convert it for you at compile time so there is no loss in performance, and you gain the readability you want.

- Kevin "BaShildy" King
Game Programmer: DigiPen
www.mpogd.com

##### Share on other sites
Remember, there are 2*PI radians in a circle. So 360 degrees ~= 2 * PI radians. So to convert degrees to radians, just do this:

Hope this helps!

##### Share on other sites
Using radians is more accurate than degrees since they''re expressed with floats.

##### Share on other sites
Thnx,

Its true that they are expressed with floats, but if my angle is some number in degrees and I then convert that to radians, I lose data because of the non-exactness of conversion. In my case i need my camera to not be moving on the X axis if a given angle is 0, but since it was converted to radians its actually 0.010221 and is causing my cam to "float". This is un acceptable

''Very funny, Scotty. Now beam down my clothes.'' -

[TheBlackJester]

##### Share on other sites
Double precision?

[ GDNet Start Here | GDNet FAQ | MS RTFM | STL | Google ]
Thanks to Kylotan for the idea!

##### Share on other sites
Why not just use radians everywhere and not bother about conversions anywhere? Unless you have to have the user entering angles or reading angles, then I see no reason to use degrees.

Trying is the first step towards failure.

##### Share on other sites
There''s also no rule saying that you need an integer number of degrees! You can use floating points for radian angles AND degree angles.

• 10
• 9
• 48
• 12
• 10
• ### Forum Statistics

• Total Topics
631383
• Total Posts
2999689
×