Mandelbrot set: Difference between revisions

Content deleted Content added
Majow (talk | contribs)
Majow (talk | contribs)
→‎Normalized Iteration Count, Distance Estimation and Mercator Maps: Restored the link to Syntopia and used num as a keyword argument.
Line 7,376:
===Normalized Iteration Count, Distance Estimation and Mercator Maps===
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 Syntopia: [httpshttp://enblog.wikipediahvidtfeldts.orgnet/wikiindex.php/Plotting_algorithms_for_the_Mandelbrot_set#Exterior_distance_estimation2011/09/distance-estimated-3d-fractals-v-the-mandelbulb-different-de-approximations ''AdvancedDistance plottingEstimated algorithms3D Fractals (V): ExteriorThe distanceMandelbulb & Different DE estimationApproximations'']).
Finally, the Mandelbrot set is also printed with a scatter plot which will be misused later for a nice effect.
<lang python>import numpy as np
Line 7,382:
 
d, h = 800, 600 # pixel density (= image width) and image height
n, r = 200100, 500 # number of iterations and escape radius (r > 2)
 
x = np.linspace(0, 2, num=d + 1)
y = np.linspace(0, 2 * h / d, num=h + 1)
 
A, B = np.meshgrid(x - 1, y - h / d)
Line 7,424:
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,431:
n, r = 800, 1000 # number of iterations and escape radius (r > 2)
 
x = np.linspace(0, 2, num=d + 1)
y = np.linspace(0, 2 * h / d, num=h + 1)
 
A, B = np.meshgrid(x * np.pi, y * np.pi)