tangent recursion

This is a discussion on tangent recursion within the C++ Programming forums, part of the General Programming Boards category; im just curuios but the book im using only shows you how to do a recursive sine function... how the ...

  1. #1
    Registered User
    Join Date
    Apr 2007
    Posts
    2

    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?

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,417
    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.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Lean Mean Coding Machine KONI's Avatar
    Join Date
    Mar 2007
    Location
    Luxembourg, Europe
    Posts
    444
    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Template Recursion Pickle
    By SevenThunders in forum C++ Programming
    Replies: 20
    Last Post: 02-05-2009, 08:45 PM
  2. convert Recursion to linear can it be done
    By umen242 in forum C++ Programming
    Replies: 2
    Last Post: 10-15-2008, 02:58 AM
  3. a simple recursion question
    By tetra in forum C++ Programming
    Replies: 6
    Last Post: 10-27-2002, 09:56 AM
  4. stack and recursion help needed!
    By LouB in forum C++ Programming
    Replies: 3
    Last Post: 07-01-2002, 02:19 PM
  5. selection sorting using going-down and going-up recursion
    By Unregistered in forum C Programming
    Replies: 1
    Last Post: 11-02-2001, 01:29 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21