[Tutor] Complex roots

Dick Moores rdm at rcblue.com
Sun Dec 12 09:33:20 CET 2004

Tim (was: Bill) Peters wrote at 20:45 12/10/2004:
>[Dick Moores]
> > Aw, that's just amazing.

<Terrific and clear explanation snipped>

> > I put your function in http://www.rcblue.com/Python/croots.py,
>That's fine by me -- but I'd appreciate it if you stopped claiming
>there that my name is Bill <wink>.

Are you sure? Well, OK. Tim it is.

> > Actually, I'm trying to write a Python script that computes all 3
> > roots of a cubic equation. Do you happen to have one tucked
> > away in your store of wisdom and tricks? (One for real coefficients
> > will do).
>I don't, no.  You can code one for cubics from Cardano's formula, e.g.,
>     http://mathworld.wolfram.com/CubicFormula.html
>but it's rarely worth the bother -- it's complicated and doesn't

I accept this challenge to write a complicated script of little value.

>In practice, roots for polynomials beyond quadratics are
>usually obtained by numerical approximation methods that don't care
>much about the polynomial's degree.

Are these "numerical approximation methods" pythonically possible?

Dick (AKA George) Moores
rdm at rcblue.com

More information about the Tutor mailing list