From: "Damian Yerrick" Newsgroups: comp.os.msdos.djgpp References: Subject: Re: Inverse trigonometry functions in Djgpp Lines: 43 Organization: Pin Eight Software X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2919.6600 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 Message-ID: X-Trace: +r4CDh35L69O7vBk6gmDcbC4ZHtknIWMsr2q8agTA0P6XRqGWcJNlcoECElAn68a2qnor2/UWv/4!O1opsB77YrJc4bl6lvWa7O+q6joPq3Xmljb6f/nUxp7Ef4bS2aMdgYKd2ZKNNl9AhVAUYA== X-Complaints-To: abuse AT gte DOT net X-Abuse-Info: Please be sure to forward a copy of ALL headers X-Abuse-Info: Otherwise we will be unable to process your complaint properly NNTP-Posting-Date: Thu, 30 Dec 1999 05:51:48 GMT Distribution: world Date: Thu, 30 Dec 1999 05:51:48 GMT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com "Jarkko Kähkönen" wrote in message news:wKza4.591$eq DOT 7079 AT uutiset DOT nic DOT fi... > Atan () - don't work! > Here is a bit of my code: > > float direction; > > direction = atan ( 120 / 90 ); > printf ("%f", direction"); > > And output is this: > 0.927-something > > But with calculator it is: > tan^-1 (120 / 90) = 53.13-something > > Is atan () right inverse tan function? Yes. Ever heard of something called a radian? Try putting your little calculator into "radian" mode (push DRG for drugs?) and try your arctan again. Basically, there are 2*Pi (about 6.283) radians in a circle instead of 360 degrees. Multiply atan's "radian" output by 57.29578 to get degrees. -- Damian Yerrick http://yerricde.tripod.com/ View full .sig: http://www.rose-hulman.edu/~yerricde/sig.html and now you must pay...