Quote:
Originally Posted by newton418
You can also approximation trig functions using a finite number of terms from the Taylor series.
For instance, arctan(x) is approximately equal to X - X^3/3 + X^5/5 - X^7/7
When -1<X<1
I'm not a coder, so I don't know what you’re trying to do, but from what I do understand about code, a Taylor series approximation should be fairly easy to implement.
|
Just to elaborate for those who haven't had second semester Calculus (BC Calc), a Taylor series is a mathematical construct that consists of a sequence of terms (often infinitely long), the sum of which approaches, know as converging at, a value equal to the value of the function used to generate the series. Taylor series are "centered" at a value and the points for which they converge to the correct number surround this value, in the above example, the series is centered at x=0 and the Taylor series converges from -1<x<1. Anyway, Taylor series allow you to use relatively simple polynomials to calculate rather difficult problems, like sin(.3245212432) to almost degree of accuracy that you desire, simply by varying the number of terms. This is actually how your calculator calculates trig functions, as it is rather hard to do straight up.