some new stuff.

idk its all pretty fun! some C++ too!
This commit is contained in:
2025-10-15 11:16:51 +02:00
parent 1b31319003
commit d0eaabdd87
23 changed files with 3448 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
from numba import njit
import numpy as np
@njit
def generate_mandelbrot(xmin, xmax, ymin, ymax, width, height, max_iter):
img = np.zeros((height, width), dtype=np.uint32)
for i in range(height):
for j in range(width):
x0 = xmin + (xmax - xmin) * j / width
y0 = ymin + (ymax - ymin) * i / height
x, y = 0.0, 0.0
iter = 0
while x*x + y*y <= 4.0 and iter < max_iter:
xtemp = x*x - y*y + x0
y = 2*x*y + y0
x = xtemp
iter += 1
img[i, j] = iter
return img