# Trig functions.... waht exactly is the function?

**URL:** https://boards.straightdope.com/t/trig-functions-waht-exactly-is-the-function/203243
**Category:** Factual Questions
**Created:** [September 23, 2003, 3:49am UTC](https://boards.straightdope.com/t/trig-functions-waht-exactly-is-the-function/203243 "2003-09-23T03:49:07Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![culov](https://avatars.discourse-cdn.com/v4/letter/c/e79b87/32.png) [@culov](https://boards.straightdope.com/u/culov)
#### Post date: [September 23, 2003, 3:49am UTC](https://boards.straightdope.com/t/trig-functions-waht-exactly-is-the-function/203243/1 "2003-09-23T03:49:07Z")

</div>

Well, if i type sin(sqrt(3)/2) in my calculator, i know what im doing, but i have no idea what the calculator is doing… every since i first began “using” trig functions, ive been wanting to know what the exact fuctions, but ive never seen how its calculated.

Ok, so to rephrase my question, what the hell does my calculator do when i enter sin(60)??

---

<div class="post-metadata">

### Author: ![Zulema](https://avatars.discourse-cdn.com/v4/letter/z/db5fbb/32.png) [@Zulema](https://boards.straightdope.com/u/Zulema)
#### Post date: [September 23, 2003, 4:03am UTC](https://boards.straightdope.com/t/trig-functions-waht-exactly-is-the-function/203243/2 "2003-09-23T04:03:05Z")

</div>

Take a triangle with a 90 degree angle and a 60 degree angle. The side opposite the 90 degree angle is the hypotenuse, the side opposite the 60 degree angle is called the opposite side. The sine of the 60 degree angle is equal to the length of the opposite divided by the length of the hypotenuse. This will be the same amount no matter what size the triangle is.

---

<div class="post-metadata">

### Author: ![Zulema](https://avatars.discourse-cdn.com/v4/letter/z/db5fbb/32.png) [@Zulema](https://boards.straightdope.com/u/Zulema)
#### Post date: [September 23, 2003, 4:07am UTC](https://boards.straightdope.com/t/trig-functions-waht-exactly-is-the-function/203243/3 "2003-09-23T04:07:10Z")

</div>

I didn’t really finish answering that, I think the calculator has that memorized.

---

<div class="post-metadata">

### Author: ![DarrenS](https://avatars.discourse-cdn.com/v4/letter/d/977dab/32.png) [@DarrenS](https://boards.straightdope.com/u/DarrenS)
#### Post date: [September 23, 2003, 4:11am UTC](https://boards.straightdope.com/t/trig-functions-waht-exactly-is-the-function/203243/4 "2003-09-23T04:11:35Z")

</div>

I believe modern calculators use look-up tables for most trig functions, and interpolate as necessary.

The alternative would be a [Taylor series](http://mathworld.wolfram.com/TaylorSeries.html) expansion. From a mathematical point of view, definitions of trig functions in terms of Taylor series have the advantage of allowing complex variables.

---

<div class="post-metadata">

### Author: ![CurtC](https://avatars.discourse-cdn.com/v4/letter/c/ce73a5/32.png) [@CurtC](https://boards.straightdope.com/u/CurtC)
#### Post date: [September 23, 2003, 4:16am UTC](https://boards.straightdope.com/t/trig-functions-waht-exactly-is-the-function/203243/5 "2003-09-23T04:16:13Z")

</div>

Why would modern calculators interpolate, since calculators going back to the HP-35 (circa 1974) did these functions with Taylor series? The algorithms are long since done, and even a 30 year old model is plenty fast enough.

---

<div class="post-metadata">

### Author: ![askol](https://avatars.discourse-cdn.com/v4/letter/a/53a042/32.png) [@askol](https://boards.straightdope.com/u/askol)
#### Post date: [September 23, 2003, 4:22am UTC](https://boards.straightdope.com/t/trig-functions-waht-exactly-is-the-function/203243/6 "2003-09-23T04:22:04Z")

</div>

Just so I can have some input:

My calcuator (TI-89) gives a different result for sin(x) and sin(x+ .00005). That would be a huge lookup up table, and I don’t know how much harder interpolation is compared to a taylor series.

---

<div class="post-metadata">

### Author: ![DarrenS](https://avatars.discourse-cdn.com/v4/letter/d/977dab/32.png) [@DarrenS](https://boards.straightdope.com/u/DarrenS)
#### Post date: [September 23, 2003, 4:34am UTC](https://boards.straightdope.com/t/trig-functions-waht-exactly-is-the-function/203243/7 "2003-09-23T04:34:04Z")

</div>

Previous thread discussing this:

[http://boards.straightdope.com/sdmb/showthread.php?threadid=146550](http://boards.straightdope.com/sdmb/showthread.php?threadid=146550)

---

<div class="post-metadata">

### Author: ![Desmostylus](https://avatars.discourse-cdn.com/v4/letter/d/c57346/32.png) [@Desmostylus](https://boards.straightdope.com/u/Desmostylus)
#### Post date: [September 23, 2003, 10:28am UTC](https://boards.straightdope.com/t/trig-functions-waht-exactly-is-the-function/203243/8 "2003-09-23T10:28:44Z")

</div>

The formula used in Bill Gate’s first version of Basic was:

sin(x) = x - x[sup]3[/sup]/3! + x[sup]5[/sup]/5! - x[sup]7[/sup]/7! + x[sup]9[/sup]/9!

(MacLaurin series)

cos and tan were derived from sin.

Monte Davidoff wrote the math bits of the program, including the above. Bill himself wrote most of the rest. Paul Allen did the remaining bits.

---

<div class="post-metadata">

### Author: ![Desmostylus](https://avatars.discourse-cdn.com/v4/letter/d/c57346/32.png) [@Desmostylus](https://boards.straightdope.com/u/Desmostylus)
#### Post date: [September 23, 2003, 10:48am UTC](https://boards.straightdope.com/t/trig-functions-waht-exactly-is-the-function/203243/9 "2003-09-23T10:48:08Z")

</div>

Some interesting background on the source code for that version of Basic can be found here: [Raiders of the Lost Altair BASIC Source Code](http://www.theregister.co.uk/content/4/18915.html)

> [@](#):
>
> Diss-assembly
> 
> But soft! The tale gets even more interesting. Griffiths’ friend Reuben Harris, a programmer based in London, has been disassembling the earliest Altair BASIC he could find. It’s the same 4K interpreter written by Gates, Allen and Davidoff, and the latter was evidently tickled by the project when we spoke to him on Thursday evening.

Reuben Harris is a poster on SDMB, under the username **Reuben**. **Reuben** ’s disassembly efforts can be seen here: [Altair BASIC 3.2 (4K) - Annotated Disassembly](http://66.216.21.33/altair/4k32/index2.html)

---

<div class="post-metadata">

### Author: ![biqu](https://avatars.discourse-cdn.com/v4/letter/b/7feea3/32.png) [@biqu](https://boards.straightdope.com/u/biqu)
#### Post date: [September 23, 2003, 12:50pm UTC](https://boards.straightdope.com/t/trig-functions-waht-exactly-is-the-function/203243/10 "2003-09-23T12:50:12Z")

</div>

Not even the previously linked thread offered this [explanation of TI calculators’ internal trig computation algorithms](http://clem.mscd.edu/~talmanl/CORDIC02.txt).
