How to plot the Mandelbrot set
[CG]Maxime
220.6K views
Open Source Your Knowledge, Become a Contributor
Technology knowledge has to be shared and made accessible for free. Join the movement.
Julia Sets
Julia Sets also offer great fractals. The definition of the Julia sets is very similar to the mandelbrot set. As a reminder, the Mandelbrot set is the set of the complex numbers for which the sequence
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from math import log, log2
MAX_ITER = 80
def julia(c, z0):
z = z0
n = 0
while abs(z) <= 2 and n < MAX_ITER:
z = z*z + c
n += 1
if n == MAX_ITER:
return MAX_ITER
return n + 1 - log(log2(abs(z)))
Enter to Rename, Shift+Enter to Preview
1
from PIL import Image, ImageDraw
Enter to Rename, Shift+Enter to Preview
I hope you liked this playground. Please leave a comment below!
Open Source Your Knowledge: become a Contributor and help others learn. Create New Content