Xref: utzoo sci.math:8539 comp.graphics:8373 Path: utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!usc!brutus.cs.uiuc.edu!rpi!wrf From: wrf@mab.ecse.rpi.edu (Wm Randolph Franklin) Newsgroups: sci.math,comp.graphics Subject: Re: Solution to quartic eqn? Keywords: quartic, polynomial, roots Message-ID: <1989Nov9.225450.4723@rpi.edu> Date: 9 Nov 89 22:54:50 GMT References: <19606@vax5.CIT.CORNELL.EDU> Organization: Rensselaer Polytechnic Institute, Troy NY Lines: 25 In <19606@vax5.CIT.CORNELL.EDU> cfwy@vax5.cit.cornell.edu (Larry Gritz) writes: >I need an algorithm to find the roots of a quartic (polynomial of degree 4) >equation to find the solution to a ray-torus intersection test. Quadratic >is easy, and I found a solution to cubic, but I can't get a reference for >quartic. The equation looks like this: > a4*x^4 + a3*x^3 + a2*x^2 + a1*x + a0 = 0 >I'd appreciate a pointer to a solution, or better, a short algorithm >(efficient is good, too). The standard explicit solution may be found in handbooks such as Abramowitz. One disadvantage is that it requires using complex numbers even if all coefficients and all roots are real. This includes taking cube roots of complex numbers. In practice, finding any one root by Newton and then deflating to a cubic might be fastest. One problem with Newton is that it converges very slowly to multiple roots. However the multiple roots of f are roots of gcd(f,f'), so you can identify them. -- Wm. Randolph Franklin Internet: wrf@ecse.rpi.edu (or @cs.rpi.edu) Bitnet: Wrfrankl@Rpitsmts Telephone: (518) 276-6077; Telex: 6716050 RPI TROU; Fax: (518) 276-6261 Paper: ECSE Dept., 6026 JEC, Rensselaer Polytechnic Inst, Troy NY, 12180