Thread: tangent recursion

  1. #1
    Registered User
    Join Date
    Apr 2007

    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:

    anyone have code online regarding this?

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    The edge of the known universe
    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.

  3. #3
    Lean Mean Coding Machine KONI's Avatar
    Join Date
    Mar 2007
    Luxembourg, Europe
    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:
    Epsilon(1, infinity) f(x)
    sum = 0;
    for(x = 1; x < infinity; x++)
        sum += f(x)
    sum = 0;
    while (x < infinity)
        sum += f(x++)
    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, 09: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, 10: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, 02:29 PM