Package gov.nih.mipav.model.algorithms
Class CubicEquation
- java.lang.Object
-
- gov.nih.mipav.model.algorithms.CubicEquation
-
public class CubicEquation extends java.lang.Object
This is a port of code written by Gerolamo Cardano under the Code Project Open Licence. A copy of the license if found at https://www.codeproject.com/info/cpol10.aspx. The equation is a1*x**3 + b*x**2 + c*x + d = 0 If result = 0, a1 = 0 If result = 1, x1 is real and x2 and x3 are complex with x3 = complex conjugate of x2 If result = 2, there are 3 real roots of which at least 2 are equal If result = 3, 3 real and unequal roots are found- Author:
- ilb
-
-
Constructor Summary
Constructors Constructor Description CubicEquation()
CubicEquation(double a1, double b, double c, double d, double[] x1real, double[] x2real, double[] x2imag, double[] x3real, double[] x3imag, int[] result)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
run()
void
selfTest()
double
Xroot(double a, double x)
-