delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/12/17/02:43:55

From: Kertis Henderson <kertis AT frozenwave DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: sin() and cos() ???
Date: Thu, 17 Dec 1998 02:39:35 -0500
Organization: Penn State University, Center for Academic Computing
Lines: 24
Message-ID: <3678B537.F0ACF0AF@frozenwave.com>
References: <367833E6 DOT 84CD87A5 AT pge DOT com>
NNTP-Posting-Host: kah190.rh.psu.edu
Mime-Version: 1.0
X-Mailer: Mozilla 4.5 [en] (X11; I; Linux 2.0.36 i686)
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

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