operator * method

Complex operator *(
  1. Complex other
)

The products of two complex numbers.

Implementation

Complex operator *(Complex other) {
  final realPart = real * other.real - imaginary * other.imaginary;
  final imaginaryPart = real * other.imaginary + imaginary * other.real;

  return Complex(realPart, imaginaryPart);
}