Last active
July 8, 2020 12:25
-
-
Save abecus/f298823b7f0cb498f086a6baf187b9ec to your computer and use it in GitHub Desktop.
creates Mandelbrot Set
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def plotter(n, thresh, max_steps=25): | |
mx = 2.48 / (n-1) | |
my = 2.26 / (n-1) | |
mapper = lambda x,y: (mx*x - 2, my*y - 1.13) | |
img=np.full((n,n), 255) | |
for x in range(n): | |
for y in range(n): | |
it = get_iter(complex(*mapper(x,y)), thresh=thresh, max_steps=max_steps) | |
img[y][x] = 255 - it | |
return img |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment