9
$\begingroup$

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!

$\endgroup$
  • $\begingroup$ This is a great first question! Keep at it! $\endgroup$ – The Count Jul 5 '16 at 13:48
  • $\begingroup$ Thank you for the encouragement :) $\endgroup$ – Mati Esayias Jul 5 '16 at 21:44
3
$\begingroup$

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!

$\endgroup$
  • 1
    $\begingroup$ I really like this answer. I went towards the 'what is sine' approach for my answer, but I really like the detail here. +1 $\endgroup$ – The Count Jul 5 '16 at 13:47
  • $\begingroup$ Thank you very much +tilper $\endgroup$ – Mati Esayias Jul 5 '16 at 13:55
  • 1
    $\begingroup$ This answer was very helpful and i hope it will be helpful to others with this question $\endgroup$ – Mati Esayias Jul 5 '16 at 13:56
  • 1
    $\begingroup$ What are the odds i asked this question in time to sign up for the Coursera course! $\endgroup$ – Mati Esayias Jul 5 '16 at 17:59
2
$\begingroup$

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.

$\endgroup$
1
$\begingroup$

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.

$\endgroup$
  • $\begingroup$ What's the reason that formula works? (BTW Thank you very much for your response) $\endgroup$ – Mati Esayias Jul 5 '16 at 13:31
  • $\begingroup$ It looks kind of complicated $\endgroup$ – Mati Esayias Jul 5 '16 at 13:33
1
$\begingroup$

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!

$\endgroup$
  • $\begingroup$ 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? $\endgroup$ – Mati Esayias Jul 5 '16 at 17:55
  • $\begingroup$ 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! $\endgroup$ – The Count Jul 5 '16 at 18:01
  • $\begingroup$ 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. $\endgroup$ – The Count Jul 5 '16 at 18:02
  • $\begingroup$ I just signed up so i don't know what up votes are? $\endgroup$ – Mati Esayias Jul 5 '16 at 18:20
  • $\begingroup$ I have a feeling it has something to do with the orange arrows facing up?? $\endgroup$ – Mati Esayias Jul 5 '16 at 18:21
1
$\begingroup$

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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.