Mandelbrot set: Difference between revisions

m
Line 7,208:
Actually the same, but without optimizations and therefore better suited for teaching.
The ''escape time'', ''normalized iteration count'' and ''exterior distance estimation'' algorithms are used with NumPy and complex matrices (see Wikipedia: [https://en.wikipedia.org/wiki/Plotting_algorithms_for_the_Mandelbrot_set#Continuous_(smooth)_coloring ''Plotting algorithms for the Mandelbrot set: Continuous (smooth) coloring''] and [https://en.wikipedia.org/wiki/Plotting_algorithms_for_the_Mandelbrot_set#Exterior_distance_estimation ''Advanced plotting algorithms: Exterior distance estimation'']).
TheFinally, the Mandelbrot set is also printed usingwith a scatter plot which will be misused later for a nice effect.
<lang python>import numpy as np
import matplotlib.pyplot as plt
Line 7,255:
He uses 10^(3*h/d) = 1000^(h/d) instead of exp(2*pi*h/d) = 535.5^(h/d), so his images appear somewhat compressed in comparison (but not much, because 1000^5 = 10^15 = 535.5^5.5).
With the same pixel density and the same maximum magnification, the difference in height between the maps is only about 10 percent.
By misusing a scatter plot, it is now possible to create zoom images of the Mandelbrot set.
<lang python>import numpy as np
import matplotlib.pyplot as plt
Line 7,264 ⟶ 7,265:
y = np.linspace(0, 2 * h / d, h + 1)
 
A, B = np.meshgrid(np.pix * x, np.pi, y * ynp.pi)
C = 1.5 * np.exp((A + B * 1j) * 1j) - 0.74366367740001 + 0.131863214401 * 1j
 
305

edits