Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

sin() and cos()... wtf? (c++)

Name: Anonymous 2006-09-04 0:32

Check this out:

double direction, length, result1, result2;
out << "direction?\n";
cin >> direction;
result1 = cos(direction);
result2 = sin(direction);
cout << result1 << "\n";
cout << result2 << "\n";
This code is fucked up, because when I enter 45, it should return the same value (.70786 or something similar).  Instead, I get:

0.525322 (cos)
0.850904 (sin)

It's almost like the C++ library is fucked up or something.  I know I haven't forgotten basic geometry (windows calculator bears this out) and I don't think I'm going insane, so WHAT AM I DOING WRONG?

Name: Anonymous 2006-09-05 20:39

>>22
I'm 20, finished public high school in the US two years ago and took: geometry, precalc, calc 1,  calc 2, calc 3, linear algebra (the previous four being one semester each). Stop blaming the schools for your personal mediocrity.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List