Could you please be more specific? They told us we needed to convert the Taylor series into recursion formula, like this:
http://tinyurl.com/58anen and then it's supposed to be easy from there. Also, I have this example guide: double k = 0.0; double item = 1.0; double sum = item; while(fabs(item) >= eps) { k = k + 2.0; item = (-item*x*x)/(k*(k-1.0)); sum = sum + item; } The program is run like program -tan epsilon, where epsilon is the chosen approximation. Then it waits for the user input in radians. --- In [email protected], Thomas Hruska <[EMAIL PROTECTED]> wrote: > > jagomaniak wrote: > > I'm using the following series: > > > > sin x = x - x^3/3! + x^5/5! - x^7/7!... > > > > However, I'm unsure how to convert it to a function in my program. > > Break it down into simpler parts. Mathematical formulas require more > effort to convert into C/C++ (and other languages). Start with > expanding the formula to something that can be implemented more easily > in a computer program: > > sin x = x - x^3/3! + x^5/5! - x^7/7!... > > sin x = x + (-1 * (x^3/3!)) + (1 * (x^5/5!)) + (-1 * (x^7/7!))... > > That should reveal a pattern. Next, break down the formula into its > constituent components. Basically, this is a homework exercise in > whether or not you can break down a problem (or, in this case, a > mathematical formula) into its component pieces and create a plan that > you translate into code that ultimate solves the problem. This is a > skill you have to develop pretty much on your own. > > Side note: Taylor Series are typically taught at college level math, > although any trigonometry student could handle them as well. For > whatever reason, students these days are left hanging trying to > understand how the sin/cos key on their calculators work until they get > into Calc II in college. > > -- > Thomas Hruska > CubicleSoft President > Ph: 517-803-4197 > > *NEW* MyTaskFocus 1.1 > Get on task. Stay on task. > > http://www.CubicleSoft.com/MyTaskFocus/ >
