Skip to content

Commit ab415ac

Browse files
committed
revised plotter
1 parent 08d3b32 commit ab415ac

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/venv

Diff for: complex2.py

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import math
2+
import cv2
3+
import numpy as np
4+
5+
size = 10
6+
7+
res = np.linspace(-size, size, size * 2 + 1)
8+
ims = np.linspace(-size, size, size * 2 + 1) * 1j
9+
10+
nums = np.zeros((len(res) - 1, len(ims) - 1), dtype=np.complex_)
11+
12+
for i in range(-size, size):
13+
for j in range(-size , size):
14+
nums[i+size, j+size] = complex(i, j) #<-- to maintain the expected shape
15+
16+
def function(complex_num):
17+
return complex_num-2j
18+
19+
print(nums[1])
20+
print(function(nums)[1])

0 commit comments

Comments
 (0)