Mandelbrot set: Difference between revisions

→‎Advanced: Distance estimation and Mercator zoom: Corrected the distance formula (the correct factor is 0.5 and not 2, see Syntopia)
m (→‎Basic: Escape time and normalized iteration count: The large value for r was only for the subsequent correction of the iteration numbers.)
(→‎Advanced: Distance estimation and Mercator zoom: Corrected the distance formula (the correct factor is 0.5 and not 2, see Syntopia))
Line 7,213:
 
===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'']).
<lang python>import numpy as np
import matplotlib.pyplot as plt
Line 7,237:
 
N = abs(Z) >= r
T[N] = 20.5 * np.log(abs(Z[N])) * np.log(abs(Z[N])) / abs(dZ[N])
 
fig, ax = plt.subplots(figsize=(4, 3))
Line 7,273:
 
N = abs(Z) >= r
T[N] = 20.5 * np.log(abs(Z[N])) * np.log(abs(Z[N])) / abs(dZ[N])
 
fig, ax = plt.subplots(figsize=(4, 16))
305

edits