Class QuadraticSolver
java.lang.Object
com.github.gbenroscience.math.quadratic.QuadraticSolver
Solves quadratic equations of the form ax² + bx + c = 0. Includes numerical
stability for real roots and correct complex conjugate pairs.
* @author GBEMIRO
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal double[]solutions[0], solutions[1]: Real/Imag parts of root 1 solutions[2], solutions[3]: Real/Imag parts of root 2 solutions[4]: 0 for Real, 1 for Complex -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
solutions
public final double[] solutionssolutions[0], solutions[1]: Real/Imag parts of root 1 solutions[2], solutions[3]: Real/Imag parts of root 2 solutions[4]: 0 for Real, 1 for Complex
-
-
Constructor Details
-
QuadraticSolver
public QuadraticSolver(double a, double b, double c)
-
-
Method Details
-
setA
public void setA(double a) -
getA
public double getA() -
setB
public void setB(double b) -
getB
public double getB() -
setC
public void setC(double c) -
getC
public double getC() -
isComplex
public final boolean isComplex() -
solve
Returns the solutions as a formatted string. -
soln
Returns the solutions as an array of strings. -
toString
-
main
-