Originally published on the dev.to platform here
#Phase of complex number
The phase or the argument of any complex number can be found out using the phase()
function.
#Polar form of complex number.
We can convert a complex number to polar form using the polar()
and back into rectangular form using the rect()
function.
Note the return types for the functions
polar()
returns a tuple.rect()
returns a complex number.
#Functions is the cmath module
Let us now explore the functions in the cmath module which are frequently used. The example below explains the use of the most commonly used functions. Entire list of functions with documentation can be found here
Note- j is often used in electronics instead of i, hence in Python expressions like
1+1i
are written as1+ij
#Applications of complex numbers to computer science.
Well I know you all must be wondering why in the world are we learning about complex numbers. Well, this is because complex numbers are a very handy tool in solving many real world problems. They are a great way to store in coordinate systems. As we just saw, they are very easy to implement than when compared to vectors. In Python, complex numbers can be operated naturally just like plain old real numbers.
Other applications of complex numbers include-
- Signal processing
- Image processing
- Scientific computing
- Graphics
- Computer vision
- Data compression
Read also
#For those who are new to the concept of complex numbers might like the video below.
Did You like the content?😎 Please let me know in the comment section on dev.to 👇. And don't forget to like the post if you did. 😍 I am open to any suggestions or doubts. 🤠 Just post in the comments on dev.to or gmail me. 😉 Thank you all👍
Please star this repository!