Quadratic constructor

Quadratic({
  1. Complex a = const Complex.fromReal(1),
  2. Complex b = const Complex.zero(),
  3. Complex c = const Complex.zero(),
})

These are examples of quadratic equations, where the coefficient with the highest degree goes first:

// f(x) = x^2 - 6x + 5
final eq = Quadratic(
  a: Complex.fromReal(2),
  b: Complex.fromReal(-6),
  c: Complex.fromReal(5),
);

// f(x) = ix^2 - 3
final eq = Quadratic(
  a: Complex.fromImaginary(1),
  c: Complex.fromReal(-3),
);

Use this constructor if you have complex coefficients. If no Complex values are required, then consider using Quadratic.realEquation for a less verbose syntax.

Implementation

Quadratic({
  Complex a = const Complex.fromReal(1),
  Complex b = const Complex.zero(),
  Complex c = const Complex.zero(),
}) : super([a, b, c]);