www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/12/30/08:54:35

From: "Damian Yerrick" <NOSP AT Msnews@pineight.8m.com>
Newsgroups: comp.os.msdos.djgpp
References: <wKza4.591$eq DOT 7079 AT uutiset DOT nic DOT fi>
Subject: Re: Inverse trigonometry functions in Djgpp
Lines: 43
Organization: Pin Eight Software <http://pineight.8m.com/>
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: <UpCa4.4058$wd2.81463@dfiatx1-snr1.gtei.net>
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" <jarkko DOT kahkonen AT mbnet DOT fi> 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...


- Raw text -


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