Class QuarticRootFormula
- java.lang.Object
-
- dev.nm.analysis.function.polynomial.root.QuarticRootFormula
-
- All Implemented Interfaces:
QuarticRoot.QuarticSolver
public class QuarticRootFormula extends Object implements QuarticRoot.QuarticSolver
This is a quartic equation solver that solves \(ax^4 + bx^3 + cx^2 + dx + e = 0\) using a root-finding formula.- See Also:
- PlanetMath: QuarticRoot Formula
-
-
Constructor Summary
Constructors Constructor Description QuarticRootFormula()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Number>
solve(double a, double b, double c, double d, double e)
Solve \(ax^4 + bx^3 + cx^2 + dx + e = 0\).List<Number>
solve(Polynomial polynomial)
Solve \(ax^4 + bx^3 + cx^2 + dx + e = 0\).
-
-
-
Method Detail
-
solve
public List<Number> solve(double a, double b, double c, double d, double e)
Description copied from interface:QuarticRoot.QuarticSolver
Solve \(ax^4 + bx^3 + cx^2 + dx + e = 0\).- Specified by:
solve
in interfaceQuarticRoot.QuarticSolver
- Parameters:
a
- ab
- bc
- cd
- de
- e- Returns:
- the list of roots
-
solve
public List<Number> solve(Polynomial polynomial)
Solve \(ax^4 + bx^3 + cx^2 + dx + e = 0\).- Parameters:
polynomial
- a quartic equation to be solved- Returns:
- the roots of the quartic equation
- Throws:
IllegalArgumentException
- if the polynomial degree is not 4
-
-