# tangent recursion

• 04-11-2007
StoneCold
tangent recursion
im just curuios but the book im using only shows you how to do a recursive sine function... how the heck would you do a tangent function, with its mathematical approximation ? like, here:

http://en.wikipedia.org/wiki/Taylor_...mmon_functions

anyone have code online regarding this?
• 04-12-2007
Salem
I guess at some point, you need to start trying stuff for yourself rather than assuming you can find an example either in a book or online.
• 04-12-2007
KONI
I thought that if you already the mathematical formula with the Epsilon addition operator, that the rest would be trivial. I mean, getting from the epsilon notation to a for() or even recursion is nearly automatic:
Code:

``` Epsilon(1, infinity) f(x) equals sum = 0; for(x = 1; x < infinity; x++)     sum += f(x) equals sum = 0; while (x < infinity)     sum += f(x++) equals function sum(x)     return f(x) + sum(x+1)```
Change the above code slightly to add stop conditions and you're done.