Class QuarticRoot
- java.lang.Object
-
- dev.nm.analysis.function.polynomial.root.QuarticRoot
-
- All Implemented Interfaces:
PolyRootSolver
public class QuarticRoot extends Object implements PolyRootSolver
This is a quartic equation solver that solves \(ax^4 + bx^3 + cx^2 + dx + e = 0\).- See Also:
- Wikipedia: QuarticRoot equation
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
QuarticRoot.QuarticSolver
This defines a quartic equation solver.
-
Constructor Summary
Constructors Constructor Description QuarticRoot()
Construct a quartic equation solver.QuarticRoot(QuarticRoot.QuarticSolver solver)
Construct a quartic equation solver.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Number>
solve(Polynomial polynomial)
Solve \(ax^4 + bx^3 + cx^2 + dx + e = 0\).
-
-
-
Constructor Detail
-
QuarticRoot
public QuarticRoot(QuarticRoot.QuarticSolver solver)
Construct a quartic equation solver.- Parameters:
solver
- the implementation of aQuarticSolver
-
QuarticRoot
public QuarticRoot()
Construct a quartic equation solver.
-
-
Method Detail
-
solve
public List<Number> solve(Polynomial polynomial)
Solve \(ax^4 + bx^3 + cx^2 + dx + e = 0\).- Specified by:
solve
in interfacePolyRootSolver
- Parameters:
polynomial
- a quartic equation to be solved- Returns:
- the roots of the quartic equation
- Throws:
IllegalArgumentException
- if the polynomial degree is not 4
-
-