Mandelbrot set: Difference between revisions

Content added Content deleted
(Added MSX Basic and True BASIC)
m (Last improvement: Switched to a quadratic smoothing for the border detection (clearly visible at the antenna))
Line 8,074: Line 8,074:
savefig("Mandelbrot_set_3.png")
savefig("Mandelbrot_set_3.png")


N, thickness = D .> 0, 0.005 # boundary detection and interpolation
N, thickness = D .> 0, 0.01 # boundary detection and interpolation
D[N] = max.(1 .- D[N] ./ thickness, 0)
D[N] = max.(1 .- D[N] ./ thickness, 0)


heatmap(D .^ 1.0, c=:binary)
heatmap(D .^ 2.0, c=:binary)
savefig("Mandelbrot_set_4.png")</syntaxhighlight>
savefig("Mandelbrot_set_4.png")</syntaxhighlight>


Line 11,048: Line 11,048:
plt.savefig("Mandelbrot_set_3.png", dpi=200)
plt.savefig("Mandelbrot_set_3.png", dpi=200)


N, thickness = D > 0, 0.005 # boundary detection and interpolation
N, thickness = D > 0, 0.01 # boundary detection and interpolation
D[N] = np.maximum(1 - D[N] / thickness, 0)
D[N] = np.maximum(1 - D[N] / thickness, 0)


plt.imshow(D ** 1.0, cmap=plt.cm.binary, origin="lower")
plt.imshow(D ** 2.0, cmap=plt.cm.binary, origin="lower")
plt.savefig("Mandelbrot_set_4.png", dpi=200)</syntaxhighlight>
plt.savefig("Mandelbrot_set_4.png", dpi=200)</syntaxhighlight>