Finding the Conjugate of the Complex Number in Golang
Go language provides inbuilt support for basic constants and mathematical functions for complex numbers with the help of the cmplx package. You are allowed to find the conjugate of the specified complex number with the help of Conj() function provided by the math/cmplx package. So, you need to add a math/cmplx package in your program with the help of the import keyword to access the Conj() function.
func Conj(y complex128) complex128
Let us discuss this concept with the help of the given examples:
Result 1: (0.0-5.0i) Result 2: (-1.0-12.0i) Result 3: (-7.0+9.0i)
Complex Number 1: (0+2i) Conjugate 1: (0.0-2.0i) Complex Number 2: (1+6i) Conjugate 2: (1.0-6.0i) Sum : (1.0-8.0i)