delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/12/17/05:37:12

Message-Id: <199812171034.FAA02881@delorie.com>
From: "Robert Darmochwal" <robertd AT aldec DOT katowice DOT pl>
To: <djgpp AT delorie DOT com>
Subject: Re: sin() and cos() ???
Date: Thu, 17 Dec 1998 11:13:50 +0100
X-MSMail-Priority: Normal
X-Priority: 3
X-Mailer: Microsoft Internet Mail 4.70.1155
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com

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 -


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