Mandelbrot set: Difference between revisions

Content deleted Content added
Majow (talk | contribs)
→‎Normalized Counting, Distance Estimation, Mercator Maps and Perturbation Theory: Added original source for rebasing and avoided millions of unnecessary abs2(r) calculations
Majow (talk | contribs)
→‎Normalized Counting, Distance Estimation, Mercator Maps and Perturbation Theory: Fixed one last bug: epsilon can actually get very large (about 1e20 in the example), so the termination condition must be checked first.
Line 6,725: Line 6,725:
z, dz = S[index + 1] + epsilon, 2 * z * dz + 1
z, dz = S[index + 1] + epsilon, 2 * z * dz + 1
abs2_z, abs2_epsilon = abs2(z), abs2(epsilon)
abs2_z, abs2_epsilon = abs2(z), abs2(epsilon)
if abs2_z < abs2_epsilon # rebasing when orbit is near zero
if abs2_z > abs2_r
break
end
if abs2_z < abs2_epsilon
epsilon, index = z, 1
epsilon, index = z, 1
elseif abs2_z < abs2_r
index = index + 1
else
else
break
index = index + 1
end
end
end
end