visual heatmap of an elliptic curve

This commit is contained in:
narodnik
2022-07-31 09:57:43 +02:00
parent a5dd04f3af
commit ff2d1b3b9b

View File

@@ -0,0 +1,17 @@
import matplotlib.pyplot as plt
a = []
for i in range(-500, 500, 1):
row = []
for j in range(-500, 500, 1):
x, y = float(j), float(i)
x /= 2000
y /= 2000
v = y**2 - x**3 - 5
#if 0.98 < x < 1.02 and 2.4 < y < 2.6:
# print(v)
v = int(v * 1000)
row.append(v)
a.append(row)
plt.imshow(a, cmap='hot', interpolation='nearest')
plt.show()