Mandelbrot set: Difference between revisions

Content added Content deleted
(→‎Advanced: Distance estimation and Mercator zoom: abs function no longer required as B is real.)
Line 7,256: Line 7,256:


===Advanced: Distance estimation and Mercator zoom===
===Advanced: Distance estimation and Mercator zoom===
It is possible to print the Mandelbrot set with a scatter plot. Exterior distance estimation is used, which provides a smooth transition of colors (cf. Wikipedia: [https://en.wikipedia.org/wiki/Plotting_algorithms_for_the_Mandelbrot_set#Exterior_distance_estimation ''Advanced plotting algorithms: Exterior distance estimation''] and Syntopia: [http://blog.hvidtfeldts.net/index.php/2011/09/distance-estimated-3d-fractals-v-the-mandelbulb-different-de-approximations/ ''Distance Estimated 3D Fractals (V): The Mandelbulb & Different DE Approximations'']).
It is possible to print the Mandelbrot set with a scatter plot. Exterior distance estimation is used, which provides a smooth transition of colors (see Wikipedia: [https://en.wikipedia.org/wiki/Plotting_algorithms_for_the_Mandelbrot_set#Exterior_distance_estimation ''Advanced plotting algorithms: Exterior distance estimation''] and Syntopia: [http://blog.hvidtfeldts.net/index.php/2011/09/distance-estimated-3d-fractals-v-the-mandelbulb-different-de-approximations/ ''Distance Estimated 3D Fractals (V): The Mandelbulb & Different DE Approximations'']).
<lang python>import numpy as np
<lang python>import numpy as np
import matplotlib.pyplot as plt
import matplotlib.pyplot as plt
Line 7,319: Line 7,319:


X, Y = C.real, C.imag
X, Y = C.real, C.imag
S = 150 * 2 * np.pi / d * abs(np.exp(-B)) # scaling depends on the size of the figure
S = 150 * 2 / d * np.pi * np.exp(-B) # scaling depends on the size of the figure


fig, ax = plt.subplots(2, 2, figsize=(16, 16))
fig, ax = plt.subplots(2, 2, figsize=(16, 16))