Is it possible to calculate $ \sin(\alpha) $ (and other trigonometric functions) as a rational number?

105 Views Asked by At

I am creating a computer library for arbitrary-precision calculations, by expressing numbers as rationals (with an arbitrary-precision numerator and denominator).

Now, I am exploring the possibility to add trigonometric functions to this library. I know from college that certain values like $\sin(\frac{1}{2}) = \frac{\pi}{2} $ and $\sin( $ are defined and easy to remember.

Is there a way to find rational solutions of $\sin(\alpha)$ for all possible angles $\alpha$ ?

1

There are 1 best solutions below

1
On

Yes, you can use a Taylor series expansion to achieve a good rational approximation of arbitrary precision for sine.

https://en.m.wikipedia.org/wiki/Taylor_series