delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/12/17/13:15:19

From: Mike Purtell <mtp4 AT pge DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: sin() and cos() ???
Date: Thu, 17 Dec 1998 06:29:08 -0800
Organization: Pacific Gas And Electric Company
Lines: 34
Message-ID: <36791533.5B4026CB@pge.com>
References: <367833E6 DOT 84CD87A5 AT pge DOT com> <3678B537 DOT F0ACF0AF AT frozenwave DOT com>
NNTP-Posting-Host: mtp4ws02.comp.pge.com
Mime-Version: 1.0
X-Mailer: Mozilla 4.5 [en] (Win95; I)
X-Accept-Language: en
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

O.K. 2PIr-I get it... I use sin(degrees*(2PI/360)) and all is well.
I checked the djgpp info and there was no mention of units, only double
f(double). So I unfortunately ASSUMED degrees as the units.
doh!

thanks - Mike

Kertis Henderson wrote:

> 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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019