Is there something in ROOT to solve a quartic equation ?
Thank you
Maxime
Is there something in ROOT to solve a quartic equation ?
Thank you
Maxime
Maxime,
In the geometry package we have a function SolveQuartic (and Cubic).
In fact these functions could be staic functions placed somewhere else.
To use it, you can do
root [0] double v[4]
root [1] TGeoTorus t
Info in <TGeoManager::TGeoManager>: default geometry created
root [2] t.SolveQuartic(-1.,1.,1.,-1.,v)
(const Int_t)2
root [3]
or in case you have an old version of ROOT without system.rootmap
root [0] double v[4]
root [1] gSystem->Load("libGeom");
root [2] TGeoTorus t
Info in <TGeoManager::TGeoManager>: default geometry created
root [3] t.SolveQuartic(-1.,1.,1.,-1.,v)
(const Int_t)2
Thank you Rene, I would never have find it. I will take a look into it next monday.
By the way, but this is unimportant, there is a mistake in the documentation of the SolveQuartic function, the comments say :
Find real solutions of the quartic equation : x^3 + ax^2 + bx + c = 0
Input: a,b,c,d
of course, the equation solved is probably :
x^4 + ax^3 + bx^2 + c*x + d = 0
Maxime
Thanks for reporting the typo.
Now fixed in CVS and html page
Rene