Mandelbrot set: Difference between revisions

→‎Advanced: Distance estimation and Mercator zoom: Remark about the different scaling factor from Anders Sandberg was added.
(→‎Advanced: Distance estimation and Mercator zoom: Transformations are now calculated in the complex plane, no longer in the X and Y coordinates. An explanation of the maximum magnification has been added.)
(→‎Advanced: Distance estimation and Mercator zoom: Remark about the different scaling factor from Anders Sandberg was added.)
Line 7,300:
ax.scatter(A, B, s=S**2, c=T**0.5, cmap=plt.cm.nipy_spectral)
plt.savefig("Mandelbrot_plot.png", dpi=100)</lang>
A small change in the code above code allows Mercator zooms of the Mandelbrot set (cf.see David Madore: [http://www.madore.org/~david/math/mandelbrot.html ''Mandelbrot set images and videos'']).
Compression is used as described by David Madore.
See also [https://www.flickr.com/photos/arenamontanus/sets/72157615740829949 ''Mercator Mandelbrot Maps''] by Anders Sandberg.
The greatestlargest magnification is exp(2*pi*h/d). In the example it is equal to exp(2*pi*5.5), which is approximately equal to 10^15 and is also the maximum for 64-bit artithmetic.
In the example it is equal to exp(2*pi*5.5), which is about 10^15 and also the maximum for 64-bit arithmetic.
On some architectures, the accuracy can be expanded a little: Try G = np.exp ((X + Y * 1j) * np.pi * 1j, dtype = np.clongdouble) to increase the accuracy a bit.
On some architectures, the precision can be extended a bit:
On some architectures, the accuracy can be expanded a little: Try G = np.exp ((X + Y * 1j) * np.pi * 1j, dtype = np.clongdouble) to increase the accuracyprecision a bit.
Note that Anders Sandberg uses a different scaling factor.
He uses 10^3 = 1000 instead of exp(2*pi) = 535.5, so his images appear somewhat compressed in comparison (but not much, because 1000^5 is approximately equal to 535.5^5.5).
<lang python>import numpy as np
import matplotlib.pyplot as plt
305

edits