ploting roots of polynomials



On 04/27/2013 01:48 PM, Gallego Samy wrote:
> I would like to plot complex roots of polynomials, I have tried this:
> ------
> a:allroots(x^3+3*x^2+x+1,x);
> plot2d([['discrete, realpart(a), imagpart(a)]], [x,-5,5]);
> ------
> but maxima is not happy because "allroots" output is of the form 
> [x=...., x=....,x=] and "plot2d" would like a list of complex (without 
> "x=").

You have an extra argument in the allroots command and several things 
missing in the plot2d command; try it like this:

a:allroots(x^3+3*x^2+x+1);
plot2d([discrete,makelist([realpart(rhs(e)),imagpart(rhs(e))],e,a)],[style,points],[x,-5,5],[y,-5,5]);

Regards,
Jaime