In this topic, we've defined the class ComplexNumber and several magic methods for this class. However, it makes sense to define a couple of other methods so that we can use this class to its full potential.
We need methods for subtraction and division.
Subtraction
If we have 2 complex numbers and , then will equal .
Division
For division, we need to calculate the reciprocal of a complex number. If , then .
can then be represented as .