Mandelbrot set: Difference between revisions

→‎Advanced: Distance estimation and Mercator zoom: abs function no longer required as B is real.
(→‎Advanced: Distance estimation and Mercator zoom: abs function no longer required as B is real.)
Line 7,256:
 
===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.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
import matplotlib.pyplot as plt
Line 7,319:
 
X, Y = C.real, C.imag
S = 150 * 2 / d * np.pi / d * abs(np.exp(-B)) # scaling depends on the size of the figure
 
fig, ax = plt.subplots(2, 2, figsize=(16, 16))
305

edits