Mail Archives: djgpp/1997/07/12/01:38:30
You wrote:
>[deleted, but includes lines such as:]
> printf("sin(45) = %f\n", sin(45));
>If I enter 32 as the angle, the
>converted angle is 45, which is right, and then when I call the sin()
>function I get a completely different answer.
The sin() function takes its arguments in *radians*. If you don't know what
radians are, read on.
Radians are an angle measuring unit, there are (2*PI) radians in a full
circle (360 degrees). Thus, here are some macros for converting between the two:
#define degtorad(x) (((double)x / 360) * (2 * PI)) /* PI defined in math.h */
#define radtodeg(x) (((double)x / (2 * PI)) * 360)
>Do I need to get djgpp version 3? At the moment, I've got version 2.
Version 3 does not exist yet. The newest version is 2.01.
HTH
Nate Eldredge
eldredge AT ap DOT net
- Raw text -