Class LinearRoot
- java.lang.Object
-
- dev.nm.analysis.function.polynomial.root.LinearRoot
-
- All Implemented Interfaces:
PolyRootSolver
public class LinearRoot extends Object implements PolyRootSolver
This is a solver for finding the roots of a linear equation. A linear equation is an algebraic equation in which each term is either a constant or the product of a constant and (the first power of) a single variable. That is, it has this form: ax + b = 0. The solution is simplyx = -b/a
- See Also:
- Wikipedia: LinearRoot equation
-
-
Constructor Summary
Constructors Constructor Description LinearRoot()
-
-
-
Method Detail
-
solve
public List<Double> solve(Polynomial polynomial)
Solve ax + b = 0.- Specified by:
solve
in interfacePolyRootSolver
- Parameters:
polynomial
- a linear equation to be solved- Returns:
- the root of the linear equation
- Throws:
IllegalArgumentException
- if the polynomial degree is not 1
-
-