Cubic constructor
Cubic({})
These are examples of cubic equations, where the coefficient with the highest degree goes first:
// f(x) = 2x^3 + x^2 + 5
final eq = Cubic(
a: Complex.fromReal(2),
b: Complex.fromReal(1),
d: Complex.fromReal(5),
);
// f(x) = x^3 + (-2 + 6i)x
final eq = Cubic(
a: Complex.fromReal(1),
c: Complex(-2, 6),
);
Use this constructor if you have complex coefficients. If no Complex values are required, then consider using Cubic.realEquation() for a less verbose syntax.
Implementation
Cubic({
Complex a = const Complex.fromReal(1),
Complex b = const Complex.zero(),
Complex c = const Complex.zero(),
Complex d = const Complex.zero(),
}) : super([a, b, c, d]);