Mandelbrot set: Difference between revisions

m
→‎Normalized Counting, Distance Estimation, Mercator Maps and Deep Zoom: Replaced slow abs function with faster abs2 calculation
m (→‎Normalized Counting, Distance Estimation, Mercator Maps and Deep Zoom: Order reversed (consistency with above versions))
m (→‎Normalized Counting, Distance Estimation, Mercator Maps and Deep Zoom: Replaced slow abs function with faster abs2 calculation)
Line 8,885:
 
for k in range(n):
M = abs(Z).real ** 2 + Z.imag ** 2 < r ** 2
Z[M], dZ[M] = Z[M] ** 2 + C[M], 2 * Z[M] * dZ[M] + 1
 
Line 8,936:
D = np.zeros(C.shape)
 
abs2_r = r ** 2
for k in range(n):
abs2_ZM = Z.real ** 2 + Z.imag ** 2 < r ** 2
M = abs2_Z < abs2_r
E[M] = (2 * S[k] + E[M]) * E[M] + C[M]
Z[M], dZ[M] = S[k+1] + E[M], 2 * Z[M] * dZ[M] + 1
305

edits