[kde-edu]: [KDE-EDU] KMathTool, Finding roots of Cubic polynomial
Roberto Moriyon
Roberto.Moriyon at uam.es
Mon Jan 17 22:00:48 CET 2005
Hi,
in http://www.chez.com/sereinarts/ax3bx2cxd.html there is an algorithm
written in C that is suposed to solve the general cubic equation.
Regards,
Roberto
Trenton Carr wrote:
> Hello all
>
> I'm trying to implement a class that takes the (math)function of a
> hyperbola and parabola, solves them simultaneously by finding the
> roots of a cubic polynomial. This gives the intercepts between the two.
>
> ie: hyperbola y = k/x
> parabola y = ax^2+bx+c
>
> solve simultaneously: ax^3+bx^2+cx-k
>
> this can be solved by factorizing the cubic by factor theorem, like so,
>
> (x+?)(ax^2+bx+c) where ? = Int. ? can be found by
> inspection and algebraic long division.
>
> Does anyone know how to do this programmagically.
> I've googled myself silly and to be honest, I don't even know where
> to start asking for help with this.
>
> I need this to calculate the intecepts between a hyperbola and a
> parabola which I'm plotting for KMathTool.
>
> Any help from you TechnoMages would be appreciated.
>
> Kind Regards
>
> Trenton
>
>
--
Roberto Moriyon
Department of Computer Engineering
Unversidad Autonoma de Madrid
C/ Francisco Tomas y Valiente, 11
28049 Madrid (Spain)
Phone: +34-91-497-2282
Fax: +34-91-497-2235
More information about the kde-edu
mailing list