complexConjugate function

Complex complexConjugate(
  1. Complex a
)

Return the conjugate of a complex number

Examples

var c1 = Complex(real: 1, imaginary: -3);

print(c1.conjugate());

/* output:
Complex(real: 1.0, imaginary: 3.0)
*/

Implementation

Complex complexConjugate(Complex a) {
  return Complex(real: a.real, imaginary: -a.imaginary);
}