public class QuadraticRealPolynomial extends RealPolynomial
Constructor and Description |
---|
QuadraticRealPolynomial(double a,
double b,
double c)
Constructs a quadratic polynomial with the provided real coefficients.
|
Modifier and Type | Method and Description |
---|---|
double |
discriminant()
Provides the discriminant of the quadratic equation from the supplied coefficients.
|
static double |
discriminant(double a,
double b,
double c)
Provides the discriminant of the quadratic equation from the supplied coefficients.
|
double |
getA()
Gets the coefficient of the 2nd order monomial.
|
double |
getB()
Gets the coefficient of the 1st order monomial.
|
double |
getC()
Gets the coefficient of the 0th order monomial.
|
double[] |
realRoots()
Provides the real valued roots of the real polynomial.
|
static double[] |
realRoots(double a,
double b,
double c)
Provides the real valued roots of the real polynomial with the provided coefficients.
|
evaluate, evaluate, get, getOrder
public QuadraticRealPolynomial(double a, double b, double c)
a
- The coefficient of the 2nd order monomial.b
- The coefficient of the 1st order monomial.c
- The coefficient of the 0th order monomial.public final double getA()
public final double getB()
public final double getC()
@Nonnull public final double[] realRoots()
public final double discriminant()
Note that when computing QuadraticRealPolynomial.realRoots()
, a tolerance is used that may cause the number of roots to differ relative to what analysis of the discriminant would imply.
public static double discriminant(double a, double b, double c)
Note that when computing QuadraticRealPolynomial.realRoots()
, a tolerance is used that may cause the number of roots to differ relative to what analysis of the discriminant would imply.
a
- The coefficient of the 2nd order monomial.b
- The coefficient of the 1st order monomial.c
- The coefficient of the 0th order monomial.@Nonnull public static double[] realRoots(double a, double b, double c)
a
- The coefficient of the 2nd order monomial.b
- The coefficient of the 1st order monomial.c
- The coefficient of the 0th order monomial.