Plotting higher-order polynomials

Hi fellows. I'm just getting in touch with you to get your advice in finding the best methods for plotting higher-order polynomials. I've actually seen the Bairstow method and the Graeffe method. I've got not experience in plotting this kind of polynomials, this is the reazon why I'm asking for your advice.
If some of you know which method is using mathlab ( or another plotter ) please let me know it.
I hope you undertand me, I don't want any source code or anything similar, I just want your advice in finding the best method to plot polynomial.
Thank you very much.
what exactly do you want?

for *results* it is really simple to spit out x,y points in a format that matlab or excel or something can plot for you, providing a graph with very little work done.


Then all you have to do is write the equation in code, which is usually just a few lines of code even for a complex entry, and then generate points via a for loop at the grain you need to make a nice smooth curve. The more points, the smoother and better looking, but it takes a while to plot if you go overboard and crank out billions of points. Just do enough to look nice, usually a few hundred or less is more than fine.

matlab, mathmatica, etc are expensive if all you want is a graph. There are free tools that can plot most anything.
Last edited on
Hi, As I've say I just want to plot higher-order polynomial, polinomials of third orden and higher than third orden by my own source code.
I'm a good C++ programmer and I just want to implement my own source code.
Using Cardano formula I was able to plot third-orden polinomial , but, but I don't like this way; searching the web I found the Bairstow method ( based in the Newton-Raphson method ) that give me the posiblity of find real and imaginary roots.
THEN MY QUESTION IS : IS THE BAIRSTOW METHOD THE BEST ONE 0R IS THE GRAEFFE METHOD? Or what method(internally as source code ) are using other math applications to plot polinomials?

Chau Thank you very much.
@artful1st

Are you try to plot a polynomial (as in, draw a graph)
... or
solve a polynomial (as in, find its roots)?

Your title and initial post sound like the former. What you have just written sounds like the latter. There's a big difference!

Brilliant to learn that Bairstow's Method originally appeared in a book on Applied Aerodynamics! Now, that's one-up for fluid mechanics!

Have a hunt in "Numerical Recipes" - you can find older versions free online.
Last edited on
to plot it yourself you can put in a graphics library like directdraw and plot the points, along with maybe a grid so you can see the rough values if you need values (sometimes just the shape is all you need).

your use of the word plot is odd. To me, plot means draw a point on the screen at x,y where y=f(x). There isnt anything to compute beyond just evaluation of the function which is generally trivial.

Finding roots is another question. I don't know the best method, I have always just used calculus... but I have always known what the equation(s) were going into the code, not user-entered functions, making it simpler to handle.
As I said before, I just want to develop my own source code without using any other library than it don't be from my own design.
Thank you fellow very much for your interest.
I'll keep investigating.
Topic archived. No new replies allowed.