Can someone post some examples of using sine/cosine/tangent and other trig functions in C++, I can't seem to figure out how to get it to work.
I'm used to using trig functions in the TI calculator where it's in BASIC and mega simple, but C++ has the integer-float discrepancy and I can't figure it out (because trig functions almost always have a float outcome).
2 replies to this topic
#1
Posted 22 May 2011 - 11:59 AM
|
|
|
#3
Posted 22 May 2011 - 06:14 PM
One thing I've noticed is that most people learn trig functions in degrees, but in most programming languages they are in radians. As a result, sin(90) is giving you the sine of 90 radians, not 90 degrees. If you are thinking of x as being in degrees, you would do sin(x*pi/180.0).
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account

Back to top









