solutions method

  1. @override
List<Complex> solutions()
override

Finds the roots (the solutions) of the associated P(x) = 0 equation.

Implementation

@override
List<Complex> solutions() {
  final disc = discriminant();
  final twoA = const Complex.fromReal(2) * a;

  return <Complex>[
    (b.negate + disc.sqrt()) / twoA,
    (b.negate - disc.sqrt()) / twoA,
  ];
}