Mail Archives: djgpp/1998/12/17/11:45:52
From: | ajschrotenboer AT lycosmail DOT com
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | Re: sin() and cos() ???
|
Date: | Thu, 17 Dec 1998 16:29:52 GMT
|
Organization: | Deja News - The Leader in Internet Discussion
|
Lines: | 31
|
Message-ID: | <75bbhr$sqv$1@nnrp1.dejanews.com>
|
References: | <367833E6 DOT 84CD87A5 AT pge DOT com>
|
NNTP-Posting-Host: | 207.74.20.23
|
X-Article-Creation-Date: | Thu Dec 17 16:29:52 1998 GMT
|
X-Http-User-Agent: | Mozilla/4.05 [en] (Win95; I ;Nav)
|
X-Http-Proxy: | HTTP/1.1 student.westottawa.k12.mi.us (IBM-ICS), 1.0 x10.dejanews.com:80 (Squid/1.1.22) for client 207.74.20.23
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Reply-To: | djgpp AT delorie DOT com
|
The trig functions are defined w/ radians, not degrees.
To convert to degrees to radians, multiply degree measurement times 180/pi
Incidentally, 45 degrees is pi/4 radians.
In article <367833E6 DOT 84CD87A5 AT pge DOT com>,
Mike Purtell <mtp4 AT pge DOT com> 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 !
>
> Any response would be thunderously applauded
>
> Mike Purtell
> mtp4 AT pge DOT com
>
>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
- Raw text -