9

I wanted to know how a calculator finds the sine Or any other trig function with only knowing the value of the angle. I have been looking on the internet for answers because i was really interested in how Archimedes found out what the value of pi is. Then that led me to calculating the sides of right triangles but i wanted to know since Archimedes didn't have a calculator how did he find the length of the opposite side on the triangle. I searched a lot of pages but they were all so complex(i'm in middle school)to me. So basically can anyone simplify the way you(or Archimedes) can find the length of the opposite side of a right triangle?

Sorry, if this is a broad/vague question in any way or if i have made any mistakes. This is my first time asking a question online

I thank you in advance for anyone who can help!

5 Answers5

3

I think there are really two questions here:

  1. How did Archimedes find the length of the side of a right triangle opposite to a specified angle?
  2. How does a calculator evaluate trig functions?

For #1: Honestly, I think he just drew it and measured it. This then leads to the question, "How did they measure length in general?" and maybe that's actually what you were asking. Measurements of length were often based on body parts back in those days. See here for more information, including other techniques/devices.

For #2: A thorough answer is pretty technical and advanced so I'll try to simplify as much as I can.

As stated in another answer, calculators use Taylor series to evaluate trig functions. Basically a Taylor series is a way of expressing a function in terms of the four basic operations of addition, subtraction, multiplication, and division.

Every computer and every (electrically powered) calculator has a central processing unit, called a CPU for short. The CPU is made up of a bunch of tiny wires that carry electric current. When we give the computer or calculator commands (like opening or saving a file, or pressing buttons on the keyboard or calculator), the electricity gets routed through the wires in a way that makes those commands actually happen.

The most basic operations we can do with this electrical routing are addition and subtraction. Multiplication and division must be done with appropriate combinations of addition and subtraction. To put it another way, we can do addition and subtraction with basically one electrical route. But anything more complicated will require more than just one route. For example, when you tell your calculator to do $4 + 5$, it requires just one route to do it. But if you tell your calculator to do $4 \times 5$, the electricity running through the wires is really doing $4 + 4 + 4 + 4 + 4$, which takes four routes (one for each addition, and we have four additions there).

The same thing is true of more complicated operations and functions. They also require more than one electrical route, where each electrical route is basically an addition or subtraction. This is where the Taylor series helps us. The Taylor series tells us how to evaluate these functions using addition, subtraction, multiplication, and division. And remember that multiplication and division are themselves "defined" (in the electrical wiring in the CPU) in terms of addition and subtraction. So when you tell your calculator to evaluate the sine of some number, the electricity gets routed through the wires so that it actually calculates the expression given by the Taylor series.

Note that the Taylor series is an infinite series, which is of course impossible for a CPU to evaluate exactly in general, but calculators and computers have a fixed number of digits they can display anyway. Therefore it's enough to just use the first few terms of the Taylor series.

This sweeps a lot of details under the rug but I hope it clarifies things at least a little bit. If you want more info, Coursera is currently running a really good course on this. It's free. There's also one on EdX but I think it's a bit more advanced. I studied this stuff in school 12 years ago and I'm currently using both of these as refreshers before moving on to more advanced studies. The Coursera course has been really helpful for the basics, so I definitely recommend at least looking at that one.

Good luck and keep the intellectual curiosity going!

2

Most calculators don't have a lot of complex circuits to do very advanced math. So Taylor series will probably almost never be used.

An easy way to find trigonometric, inverse trigonometric, hyperbolic functions, inverse trigonometric functions, to multiply, divide, find square roots, do exponentiation, etc using the same hardware (!) is by using the CORDIC algorithm.

https://en.wikipedia.org/wiki/CORDIC
https://en.wikibooks.org/wiki/Digital_Circuits/CORDIC

The algorithm only uses only addition, subtraction, shifting and table lookup. No need for exponentiation, division, multiplication etc. The algorithm basically mimics rotations. The math side is best explained in the articles I included.

gilianzz
  • 369
1

The calculator uses Taylor series for trigonometric functions. To find the true value, you will need to add an infinite number of terms, but for calculator's precision, usually a reasonably small number is enough. These are the ones the calculator is likely to use: $$ \begin{split} \sin x &= \sum_{n=0}^\infty \frac{(-1)^n x^{2n+1}}{(2n+1)!} = x - \frac{x^3}{3!} + \frac{x^5}{5!} - \frac{x^7}{7!} \pm \ldots\\ \cos x &= \sum_{n=0}^\infty \frac{(-1)^n x^{2n}}{(2n)!} = 1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \frac{x^6}{6!} \pm \ldots\\ \end{split} $$ I have a feeling that $\tan x$ is implemented in calculators as $\frac{\sin x}{\cos x}$ but I could be wrong, and its own series is possible to be used.

gt6989b
  • 54,422
1

What the sine function really is, for example, is simply the ratio between two of the sides in a right triangle. If we know one angle is 90 degrees, and we know the angle we are working with (the one we are taking the sine of), then we know the third angle since they have to add to 180.

Then, we know the ratio of the lengths of any two sides of the triangle (not the lengths themselves). For sine, we want the side opposite the angle in the right triangle, and the hypotenuse of the right triangle. That is what the sine is, and that is what the calculator is telling you. This ratio is always the same for a given set of angles. If we increase one side's length and want to maintain all the same angles and still have a right triangle, then the other sides must all change by the same scaling factor.

As for as how it (the calculator) knows? There are many ways. gt6989b's answer is one of them. Some of the more rudimentary calculators just have a table of values and then the interpolate from there. In the old days you had to look in a big fat book that just listed values out to many, many decimal points!

The Count
  • 3,620
  • so for an equilateral triangle with all angles that are 60 degrees, that would mean the ratio is 1:1:1 since they are all the same so in that sense if one of the sides were let's say 5 km then all 3 sides would be 5 km. Because one of the angle changes then it would have an affect on each length of each side that could be calculated. So does that mean the sine, cosine and tangent are applicable for all triangle even ones without a right angle? – Mati Esayias Jul 05 '16 at 17:55
  • well, sine, cosine, etc... are applicable in all situations, but their most intuitive definitions are for right triangles only, so your equilateral example wouldn't apply, although you could make one into two right triangles by connecting the middle of any side to the opposite vertex! – The Count Jul 05 '16 at 18:01
  • btw, if these answers are helpful, consider giving upvotes to the ones you like and accepting your favorite. tilper's answer is especially nice, in my opinion. – The Count Jul 05 '16 at 18:02
  • I just signed up so i don't know what up votes are? – Mati Esayias Jul 05 '16 at 18:20
  • I have a feeling it has something to do with the orange arrows facing up?? – Mati Esayias Jul 05 '16 at 18:21
  • @MatiEsayias the arrows to the left of the questions are your way, as a community member, of showing your approval or disapproval of an answer or question. the checkmark that you see under them on this question can be clicked by you to select the single answer you like best, since it is your question. you can upvote as many answers as you want, but only select ONE as the best. – The Count Jul 05 '16 at 18:33
1

The angle in a semi-circle by Thale's theorem is a right angle. Archimedes who came later could have drawn for sin & cos values that way. Digital computers employ power series and other very fast converging series / algorithms to find the trig ratios.

Narasimham
  • 40,495