public class QuadraticEquationSolver extends Object
Modifier and Type | Class and Description |
---|---|
static class |
QuadraticEquationSolver.QuadraticRoots
Roots (solution) of a quadratic equation.
|
Modifier and Type | Method and Description |
---|---|
static QuadraticEquationSolver.QuadraticRoots |
solveQuadraticEquation(double a,
double b,
double c)
Solves a quadratic equation in form
x^2 + b^x + c = 0 . |
public static QuadraticEquationSolver.QuadraticRoots solveQuadraticEquation(double a, double b, double c) throws OperationFailedException
x^2 + b^x + c = 0
.
It does not support complex roots.
a
- coefficient for x^2
b
- coefficient for x
c
- coefficient for constant term.OperationFailedException
- if the solution requires complex roots.Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.