public class QuadraticRoot extends Object implements PolyRootSolver
Constructor and Description |
---|
QuadraticRoot() |
Modifier and Type | Method and Description |
---|---|
List<Number> |
solve(Polynomial polynomial) |
List<Number> |
solve(Polynomial polynomial,
double epsilon)
Solve \(ax^2 + bx + c = 0\).
|
public List<Number> solve(Polynomial polynomial, double epsilon)
polynomial
- a quadratic equation to be solvedepsilon
- a precision parameter: when a number |x| ≤ ε, it is considered 0IllegalArgumentException
- if the polynomial degree is not 2public List<Number> solve(Polynomial polynomial)
solve
in interface PolyRootSolver
Copyright © 2010-2020 NM FinTech Ltd.. All Rights Reserved.