You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+93Lines changed: 93 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,3 +5,96 @@ Complex class for different operations on complex numbers.
5
5
- This class is essentially for mathematical operations on complex numbers.
6
6
- It is very easy and intuitif to use, as any mathematicain would expect.
7
7
- There is more to come on this class, like power of complex numbers.
8
+
9
+
## Installation
10
+
11
+
Use the package manager [pip](https://pypi.org/project/cmpx/) to install cmpx.
12
+
13
+
```bash
14
+
pip install cmpx
15
+
```
16
+
17
+
## Usage
18
+
### Importing Complex class
19
+
```python
20
+
from cmpx.Complex import Complex
21
+
```
22
+
### Different instanciations of Complex class
23
+
```python
24
+
# Instanciation 1
25
+
number = Complex() # --> Real = 0, Imaginary = 0
26
+
print(number)
27
+
# Instanctiation 2
28
+
number = Complex(42) # --> Real = 42, Imaginary = 0
29
+
print(number)
30
+
# Instanciation 3
31
+
number = Complex(12, -3.2) # --> Real = 12, Imaginary = -3.2
32
+
print(number)
33
+
# Instanciation 4
34
+
number = Complex(im=13.2, re=5) # --> Real = 5, Imaginary = 13.2
35
+
print(number)
36
+
# Instanciation 5
37
+
number = Complex(re=3, im=-2.4, restore=False) # restore argument is by default True, whenever an error occurs on operation, the last result will be restored to the object, else if it is False then the object will be simply None.
0 commit comments