Mail Archives: djgpp/1998/12/17/05:37:12
off course you know that but...
make it like this:
float sin_d(float x){
return sin(x*3.1415926/180);
}
and similiar cos_d function...
----------
> From: Kertis Henderson <kertis AT frozenwave DOT com>
> To: djgpp AT delorie DOT com
> Subject: Re: sin() and cos() ???
> Date: Thursday, December 17, 1998 8:39 AM
>
> Mike Purtell wrote:
> >
> > What am I missing ?
> >
> > I call ...
> >
> > #include <stdio.h>
> > #include <math.h>
> > ...
> > printf("The SIN of 45 Deg is %.2f\n",sin(45) );
> > and get .851 ??
> > and then
> > printf("The COS of 45 Deg is %.2f\n",cos(45) );
> > and get .525 ????
> > ...
> > I would expect .707 for both !
>
> The sine of 45 radians is .851, and the cosine of 45 radians is .525.
> These functions don't take degrees as arguments.
>
> --
>
> Kertis Henderson
> kertis AT frozenwave DOT com
- Raw text -