public class CubicRealPolynomial extends RealPolynomial
Constructor and Description |
---|
CubicRealPolynomial(double a,
double b,
double c,
double d)
Constructs a cubic polynomial with the provided real coefficients.
|
Modifier and Type | Method and Description |
---|---|
double |
discriminant()
Provides the discriminant of the cubic equation from the supplied coefficients.
|
static double |
discriminant(double a,
double b,
double c,
double d)
Provides the discriminant of the cubic equation from the supplied coefficients.
|
double |
getA()
Gets the coefficient of the 3rd order monomial.
|
double |
getB()
Gets the coefficient of the 2nd order monomial.
|
double |
getC()
Gets the coefficient of the 1st order monomial.
|
double |
getD()
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,
double d)
Compute real roots.
|
evaluate, evaluate, get, getOrder
public CubicRealPolynomial(double a, double b, double c, double d)
a
- The coefficient of the 3rd order monomial.b
- The coefficient of the 2nd order monomial.c
- The coefficient of the 1st order monomial.d
- The coefficient of the 0th order monomial.public final double getA()
public final double getB()
public final double getC()
public final double getD()
@Nonnull public final double[] realRoots()
public final double discriminant()
public static double discriminant(double a, double b, double c, double d)
a
- The coefficient of the 3rd order monomial.b
- The coefficient of the 2nd order monomial.c
- The coefficient of the 1st order monomial.d
- The coefficient of the 0th order monomial.@Nonnull public static double[] realRoots(double a, double b, double c, double d)
a
- The coefficient of the 3rd order monomial.b
- The coefficient of the 2nd order monomial.c
- The coefficient of the 1st order monomial.d
- The coefficient of the 0th order monomial.