Thread: Math question

  1. #1
    Registered User
    Join Date
    May 2007
    Posts
    5

    Math question

    No, I am not looking for a code solution, I am looking for where to go to get a "tutorial" on how to solve the attached equation.

    Thanks.

  2. #2
    semi-colon generator ChaosEngine's Avatar
    Join Date
    Sep 2005
    Location
    Chch, NZ
    Posts
    597
    what has this got to do with C++ programming?
    "I saw a sign that said 'Drink Canada Dry', so I started"
    -- Brendan Behan

    Free Compiler: Visual C++ 2005 Express
    If you program in C++, you need Boost. You should also know how to use the Standard Library (STL). Want to make games? After reading this, I don't like WxWidgets anymore. Want to add some scripting to your App?

  3. #3
    Registered User
    Join Date
    May 2007
    Posts
    5
    I am attempting to implement it in C++, but have not touched this level of math in at least a decade. I don't even know what to call this type of formula. I don't want to get a C++ solution. I am looking for a bord that might discuss this type of math or how discussion/tutorial on implementing such math in C++

  4. #4
    semi-colon generator ChaosEngine's Avatar
    Join Date
    Sep 2005
    Location
    Chch, NZ
    Posts
    597
    well, I'd start by reading up on polynomial equations
    "I saw a sign that said 'Drink Canada Dry', so I started"
    -- Brendan Behan

    Free Compiler: Visual C++ 2005 Express
    If you program in C++, you need Boost. You should also know how to use the Standard Library (STL). Want to make games? After reading this, I don't like WxWidgets anymore. Want to add some scripting to your App?

  5. #5

  6. #6
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Moved to General Discussions.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  7. #7
    The superhaterodyne twomers's Avatar
    Join Date
    Dec 2005
    Location
    Ireland
    Posts
    2,273
    How? Matlab or mathematica

  8. #8
    S Sang-drax's Avatar
    Join Date
    May 2002
    Location
    Göteborg, Sweden
    Posts
    2,072
    One common way to find the roots of an arbitrary polynominal is to construct a matrix with the desired roots as eigenvalues (search for "companion matrix"). Then use an iterative way ("power iteration" is simple, "QR algorithm" is somewhat more advanced, but popular) to find the eigenvalues.

    You can also try to find a root using Newton's method and then divide the polynominal by (x-root) to reduce it to degree 4. There will always be at least one real root.
    Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling

  9. #9
    Registered User
    Join Date
    Sep 2001
    Posts
    752
    Quote Originally Posted by leonm54 View Post
    No, I am not looking for a code solution, I am looking for where to go to get a "tutorial" on how to solve the attached equation.

    Thanks.
    Viola!
    Code:
    float solve_poly (float a0, float a1, float a2, float a3, float a4, float a5, float x) {
       return a0 + a1 * x + a2 * x * x + a3 * x * x * x + a4 * x * x * x * x + a5 * x * x * x * x * x;
    }
    Honestly... 'solve' is a very vague word.
    Callou collei we'll code the way
    Of prime numbers and pings!

  10. #10
    S Sang-drax's Avatar
    Join Date
    May 2002
    Location
    Göteborg, Sweden
    Posts
    2,072
    Quote Originally Posted by QuestionC View Post
    Honestly... 'solve' is a very vague word.
    Is it?´He said "how to solve the attached equation". I think it is pretty clear what he meant.
    Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. another exercise question
    By luigi40 in forum C# Programming
    Replies: 3
    Last Post: 11-28-2005, 03:52 PM
  2. opengl DC question
    By SAMSAM in forum Game Programming
    Replies: 6
    Last Post: 02-26-2003, 09:22 PM
  3. More a math question than an algorithm
    By Gustaff in forum C Programming
    Replies: 1
    Last Post: 01-28-2003, 01:10 PM
  4. Stupid Math Question....really stupid
    By ToLazytoSignIn in forum A Brief History of Cprogramming.com
    Replies: 9
    Last Post: 01-16-2003, 07:36 PM
  5. Math Question
    By DarkEldar77 in forum C++ Programming
    Replies: 2
    Last Post: 09-17-2001, 12:52 PM