Summary of knowledge points of conjugate complex numbers of complex numbers in python

  • 2021-08-12 03:12:16
  • OfStack

Science students should all know about conjugation. It often appears in mathematics or physics and chemistry. It is relatively clear to describe conjugate functions on coordinate axes. The use of conjugate functions often appears in py language, and the operation is also very interesting. In computer classes, they are often used as examination questions. For students who don't know deeply or haven't thoroughly understood, take a look at the following quick reading and mastery contents prepared for everyone.

Complex Sets of Python

1. Addition, subtraction, multiplication and division between complex numbers


>>> x = 3 + 4j
>>> y = 5 + 6j
>>> x + y # (8+10j)
>>> x - y
(-2-2j)
>>> x * y
(-9+38j)
>>> x / y
(0.6393442622950819+0.03278688524590165j)

2. The built-in function abs () can calculate the modulus of complex numbers


>>> abs(x)
5.0
>>> x.imag
4.0
>>> x.real
3.0

3. Conjugate complex numbers


>>> x.conjugate()

Extension of knowledge points:

Complex numbers in python

1. The syntax for the plural is real + image j

2. Both real and imaginary parts are floating-point numbers

3. Imaginary part suffix can be "j" or "J"

4. The conjugate method of complex number can return the conjugate complex number of the complex number.


Related articles: