www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/12/18/04:42:32

Message-Id: <199812180942.EAA21706@delorie.com>
From: "Robert Darmochwal" <robertd AT aldec DOT katowice DOT pl>
To: <djgpp AT delorie DOT com>
Subject: update: sin() and cos() ???
Date: Fri, 18 Dec 1998 10:41:23 +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

alrighty then:


#include <math.h>

float sin_d(float x){

	return sin(x*M_PI/180);
}

----------
> From: Johan Henriksson <johan DOT he AT telia DOT com>
> To: djgpp AT delorie DOT com
> Subject: Re: sin() and cos() ???
> Date: Thursday, December 17, 1998 11:52 PM
> 
> from Johan Henriksson
> Primary: johan DOT he AT telia DOT com
> Second: jhe75 AT hotmail DOT com     Third: johan_he AT yahoo DOT com
> HTTP://come.to/jhewok
> -----Original Message-----
> From: Arthur <arfa AT clara DOT net>
> To: djgpp AT delorie DOT com <djgpp AT delorie DOT com>
> Date: Thursday, December 17, 1998 11:44 PM
> Subject: RE: sin() and cos() ???
> 
> 
> >> off course you know that but...
> >>
> >> make it like this:
> >>
> >> float sin_d(float x){
> >> return sin(x*3.1415926/180);
> >> }
> >
> >I think in math.h, there is a definition called PI. This is much more
> >accurate than what you've got here.
> >
> >So you can use sin(x*PI/180); instead (easier).
> >
> 
> Easier but not needed. I think no one will notice the difference between
> 3.1415926 and 3.1415926........... And another thing; I where also fooled
to
> belive that units ment radians, not degrees. Maybe someone should update
the
> help before more people come and fall into this pit?
> 
> >
> >James Arthur - jaa AT arfa DOT clara DOT net
> >http://www.jado.org/users/arfa/
> >ICQ#15054819
> >
> >
> >

- Raw text -


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