Archived

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

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

Recommended Posts

Hey, I just finished up the physics section of my current game and the reason it wasn''t working in the first place was because of degrees and radians. When I use the trigonometric functions(sine, cosine, tangent), they only work as I want them to when I change my degrees to radians. If I don''t change them, the math does not work properly. Could anyone tell me why this happens? We never encountered anything like this in Trigonometry class, except she said something about using degrees, you''re left with weird degrees in your formula dimensions. "Donkey, if it were me, you''d be dead." I cna ytpe 300 wrods pre mniute.

Share on other sites
degrees to radians? I have to change from radians to degrees. This is because the trigonometric functions return in radians as opposed to degrees.

Share on other sites
quote:
Original post by tHiSiSbOb
degrees to radians? I have to change from radians to degrees. This is because the trigonometric functions return in radians as opposed to degrees.

No, he''s right. sin() accepts radians and not degrees. That''s why it only works with radians.

-~-The Cow of Darkness-~-

If you see the image I am online

Check out PGNet.tk

Share on other sites
Well if your function is expecting radians then then the input passed in needs to be radians. if it is expecting degrees then degrees have to be passed. This would explain the odd behavior as a function designed for one is not compatible with the other unless a conversion is made.

Share on other sites
DuncanBojangles, I think you will find that in almost all real world applications (from trig to calculus and beyond where calculations are concerned) you will find radians used over "degrees". Computing is no exception either. Though it is easier to visualize degrees in angles than some not so common radian measures.

Share on other sites
Multiply your degree by PI over 180. Better yet, make it a constant:

Share on other sites
Radians aren''t too hard to work with, if you think in terms of multiples of pi so you don''t have to look at all those irrational numbers.

45 degrees = 1/4 pi radians = 0.7853... radians 90 degrees = 1/2 pi radians = 1.5708... radians180 degrees = pi radians = 3.1416... radians360 degrees = 2 pi radians = 6.2832... radians

degrees/57.2958

pi/180 * degrees

Share on other sites
Thanks for telling me that the c++ trig functions only accept radians, cowsarenotevil. That is something I did not know.

"Donkey, if it were me, you''d be dead."
I cna ytpe 300 wrods pre mniute.

1. 1
2. 2
3. 3
Rutin
23
4. 4
5. 5
khawk
14

• 9
• 11
• 11
• 23
• 10
• Forum Statistics

• Total Topics
633653
• Total Posts
3013153
×