How to calculate the sine cosine or tangent of an angle(Simply Explained)
I think there are really two questions here:
- How did Archimedes find the length of the side of a right triangle opposite to a specified angle?
- 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!
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.