Re: How does the calculator calculate cos(x)?


[Prev][Next][Index][Thread]

Re: How does the calculator calculate cos(x)?



On 18 Oct 1997 13:52:55 GMT, archdluxxx@aol.com (ArchDluxxx) wrote:

>I would like to learn how the TI's actually calculate cos(x). Can anybody help
> me!!!

Many times polynomial function are used. See the following article for
information.

Neil Padgett

--- BEGIN ARTICLE ---
Originally posted by Francois Charton <deef@pobox.oleane.com> to
comp.graphics.algorithms with
subject: Re: Sine (or Cosine) Algo. needed
on Fri, 27 Dec 1996 16:10:02 +0100
[clip]

*Important* all this calculation is done in radians : 180 degrees is
PI
(3.141592...) radians, 90 degrees is PI/2... if you plan to use many
trig
functions in your life, you'd better get used to them : they are a
must!

To convert your angle from degrees to radians divide it by 180 ad
multiply is by PI

angle_in_radians=angle_in_degrees * PI /180

now the formulae :

cos(x) = 1 - 0.49999 99963 x^2 + 0.04166 66418 x^4 - 0.00138 88397 x^6
           + 0.00002 47609 x^8 - 0.00000 02605 x^2

and

sin(x) = x - 0.16666 66664 x^3 + 0.00833 33315 x^5 - 0.00019 84090 x^7
           + 0.00000 27526 x^9 - 0.00000 00239 x^11

These two functions approximate sin() and cos() with over 8 decimal
places accuracy, and should be enough precise nearly everytime (they
are
actually those used by pocket calculators). [I took them in Handbook
of
Mathematical Functions, by Abramowitz and Stegun]

[clip some more]

--- END ARTICLE ---


Follow-Ups: References: