Another wtf!

I have this code :
1
2
3
4
#include <math.h>
int main( int argc, char* argv[] ) {
    cout << sin( 45.0 ) << '\t' << sin( 135.0 ) << '\n';
}


And the output is ... ta-dam ...

0.0883687	0.850904


WTF !?!?!?

I want to calculate a simple bullet trajectory in my game engine.
1
2
m_bullet[ i ].x += m_bullet[ i ].speed * cos( m_bullet[ i ].angle );
m_bullet[ i ].y += m_bullet[ i ].speed * sin( m_bullet[ i ].angle );


And the result is very strange because of this!

-holtaf
It expects an angle in radians, not degrees.
Aw snap! Thanks Xander314!!
Topic archived. No new replies allowed.