Last active
March 14, 2022 21:34
-
-
Save WashingtonGold/1af3d00a29de4c14f3a786e339048724 to your computer and use it in GitHub Desktop.
This file contains 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
for row in range(w): | |
for col in range(h): | |
cx = 1.5*(row - 3*w/4)/(0.5*w) | |
cy = 1.0*(col - h/2)/(0.5*h) | |
c = complex(cx, cy) | |
x = complex(0, 0) | |
for i in range(iterations): | |
if abs(x) > 4: break | |
x = x**2 + c | |
color = (i << 21) + (i << 10) + i * 8 | |
pixels[row,col] = color |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment