If I were to write my own sine function, in some programming language, how would I do it?

I know if given an angle, you can simply substitute that into a right triangle with hypotenuse 1 and determine the triangle. But to get to return the result, I keep coming back to using the sine function, which is what I'm trying to program.

So I'm just curious as to how the sine function works to a computer.

Thanks everyone.