I'm an Android programmer and am working on a graphing calculator. I have been looking for a formula for sine and cosine to put in there. I have a decent understanding of mathematics but can not seem to find this formula. Any help would be great, thanks.
Tell me more
×
Mathematics Stack Exchange is a question and answer site for
people studying math at any level and professionals in related fields. It's 100% free, no registration required.
|
|
The best-known formulas are the Taylor series:
|
|||||||||||
|
|
You might want to consider finite expressions too. Particularily $$ \cos \frac{\pi x}{2} = 4\frac{1-x^2}{4+x^4} \text{ ; for} -1 <x<1$$ and $$\sin x = \frac{{16x\left( {\pi - x} \right)}}{{5{\pi ^2} - 4x\left( {\pi - x} \right)}} \text{ ; for } 0 <x<\pi $$ They give a great approximation: see here. |
|||
|
|
|
Are you sure you don't have access to java.lang.Math? |
|||
|


