From: johne AT parallax DOT co DOT uk (John Eccleston) Newsgroups: comp.os.msdos.djgpp Subject: Re: sin & cos functions? Date: Thu, 06 Mar 97 10:50:27 GMT Organization: Parallax Solutions Ltd Message-ID: <857645423.321128@red.parallax.co.uk> References: <331E6B93 DOT 3B63 AT comports DOT com> NNTP-Posting-Host: red.parallax.co.uk Cache-Post-Path: red.parallax.co.uk!unknown AT parsnip DOT parallax DOT co DOT uk Lines: 45 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp In article <331E6B93 DOT 3B63 AT comports DOT com>, j AT comports DOT com wrote: >Anyone got a library that defines sin (sine) and cos (cosine) functions? > >If so, please e-mail me the appropriate includes and source code. > >thanks, Hi, Try the standard C header math.h which defines quite a few trigonometric and other functions. Note that the trigonometric functions work on radians not degrees! e.g.: -----> Cut Here <----- #include #include float degreesToRadians(float angle) { return angle * (PI / 180); } main() { printf("Sin of 45: %f\n", sin(degreesToRadians(45))); } -----> CUT HERE <----- Hope that helps John ________________________________________________________________ Parallax Solutions Ltd. Tel.: 01203 514522 Stonecourt, Fax.: 01203 514401 Siskin Drive, Web : http://www.parallax.co.uk/~johne Coventry CV3 4FJ Mail: johne AT parallax DOT co DOT uk ________________________________________________________________ Remember: There is no such thing as computer error, it's 100% YOUR fault ________________________________________________________________