# Knowledge Base

## Solution 11693: Algorithm for Solving Trigonometric Functions (Sine, Cosine and Tangent) on Texas Instruments' Graphing Calculators.

### How does TI graphing calculators compute values for sine, cosine and tangent?

Texas Instruments uses the CORDIC algorithm method to compute trigonometric and other transcendental functions. A recent thread on Graph-TI asks about the internal methods used to compute trigonometric and other transcendental functions.

Most practical algorithms in use for transcendental functions are either polynomial approximations or the CORDIC method. TI calculators have almost always used CORDIC, the exceptions being the CC-40, TI-74 and TI-95 which used polynomial approximations.

In the PC world, the popular Intel math co-processors like the 8087 use CORDIC methods, while the Cyrix 83D87 uses polynomial methods. There are pros and cons to both methods. References 1 and 2 give some information on these devices but not down to the detailed algorithm level.

The polynomial approximations, however, are not usually familiar ones like a Taylor's series, but more related to Chebyshev polynomials. Early work on this topic was done by Hastings (ref 3) which is a fascinating book that represents a lot of tedious work in an age when "computers" were still likely to be people!

A more recent standard reference for constructing these polynomials is Hart (ref 4). A thorough treatment of the minor details one has to deal with in implementing the full algorithms for elementary functions (like binary versus decimal number representations and ranging for general arguments) is in Cody(ref 5).

The CORDIC algorithm is a super example of an approach that is quite different from traditional math and which is very efficient. One often sees a very specialized problem solution like this in many areas of engineering and science, which makes exposure to ideas of this type valuable in education, at least for advanced students.

CORDIC is an acronym for COrdinate Rotation DIgital Computer and was developed by J.E. Volder in 1959 (ref 6). Additional articles and one book chapter covering the technique are given in references 7 - 10. All these articles are complete enough to give the essentials of the method but each one reveals interesting variations. To give you a flavor for the idea and some material to work with without tracking down these references, we will give a worked example and a general description of the principle.

The concept of CORDIC is to take an angle theta and "rotate" a vector over this angle towards zero in a series of steps such that the sum of all the steps taken equals theta and we can accumulate corresponding X and Y increments for each step such that when we complete the process, Y/X = tan(theta). Variations of this basic concept can result in all the forward and inverse trigs as well as square root, hyperbolic trigs, and the exponential and logarithm functions.

Please see the graphing calculator guidebooks for more information and examples on using the sine, cosine and tangent functions.