Data update
This commit is contained in:
parent
07c7092a52
commit
61b93a2cd1
313 changed files with 6160 additions and 346 deletions
|
|
@ -29,7 +29,13 @@ heatmap(T .^ 0.1, c=:balance)
|
|||
savefig("Mandelbrot_set_2.png")
|
||||
|
||||
N = abs.(Z) .> 2 # exterior distance estimation
|
||||
D[N] = 0.5 .* log.(abs.(Z[N])) .* abs.(Z[N]) ./ abs.(dZ[N])
|
||||
D[N] = log.(abs.(Z[N])) .* abs.(Z[N]) ./ abs.(dZ[N])
|
||||
|
||||
heatmap(D .^ 0.1, c=:balance)
|
||||
savefig("Mandelbrot_set_3.png")
|
||||
|
||||
N, thickness = D .> 0, 0.01 # boundary detection and interpolation
|
||||
D[N] = max.(1 .- D[N] ./ thickness, 0)
|
||||
|
||||
heatmap(D .^ 2.0, c=:binary)
|
||||
savefig("Mandelbrot_set_4.png")
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ gr(aspect_ratio=:equal, axis=true, ticks=true, legend=false, dpi=200)
|
|||
d, h = 200, 1200 # pixel density (= image width) and image height
|
||||
n, r = 8000, 10000 # number of iterations and escape radius (r > 2)
|
||||
|
||||
a = -.743643887037158704752191506114774 # real coordinate of the zoom center
|
||||
b = 0.131825904205311970493132056385139 # imaginary coordinate of the center
|
||||
a = -.743643887037158704752191506114774 # try: a, b, n = -1.748764520194788535, 3e-13, 800
|
||||
b = 0.131825904205311970493132056385139 # https://mathr.co.uk/web/m-location-analysis.html
|
||||
|
||||
x = range(0, 2, length=d+1)
|
||||
y = range(0, 2 * h / d, length=h+1)
|
||||
|
|
@ -31,9 +31,9 @@ X, Y = real(C), imag(C) # zoom images (adjust circle size 50 and zoom level 20
|
|||
R, c, z = 50 * (2 / d) * pi .* exp.(.- B), min(d, h) + 1, max(0, h - d) ÷ 20
|
||||
|
||||
gr(c=:nipy_spectral, axis=true, ticks=true, legend=false, markerstrokewidth=0)
|
||||
p1 = scatter(X[1z+1:1z+c,1:d], Y[1z+1:1z+c,1:d], markersize=R[1:c].^0.5, marker_z=D[1z+1:1z+c,1:d].^0.5)
|
||||
p2 = scatter(X[2z+1:2z+c,1:d], Y[2z+1:2z+c,1:d], markersize=R[1:c].^0.5, marker_z=D[2z+1:2z+c,1:d].^0.4)
|
||||
p3 = scatter(X[3z+1:3z+c,1:d], Y[3z+1:3z+c,1:d], markersize=R[1:c].^0.5, marker_z=D[3z+1:3z+c,1:d].^0.3)
|
||||
p4 = scatter(X[4z+1:4z+c,1:d], Y[4z+1:4z+c,1:d], markersize=R[1:c].^0.5, marker_z=D[4z+1:4z+c,1:d].^0.2)
|
||||
p1 = scatter(X[1z+1:1z+c,1:d], Y[1z+1:1z+c,1:d], markersize=R[1:c].^.5, marker_z=D[1z+1:1z+c,1:d].^.5)
|
||||
p2 = scatter(X[2z+1:2z+c,1:d], Y[2z+1:2z+c,1:d], markersize=R[1:c].^.5, marker_z=D[2z+1:2z+c,1:d].^.4)
|
||||
p3 = scatter(X[3z+1:3z+c,1:d], Y[3z+1:3z+c,1:d], markersize=R[1:c].^.5, marker_z=D[3z+1:3z+c,1:d].^.3)
|
||||
p4 = scatter(X[4z+1:4z+c,1:d], Y[4z+1:4z+c,1:d], markersize=R[1:c].^.5, marker_z=D[4z+1:4z+c,1:d].^.2)
|
||||
plot(p1, p2, p3, p4, layout=(2, 2))
|
||||
savefig("Mercator_Mandelbrot_zoom.png")
|
||||
|
|
|
|||
21
Task/Mandelbrot-set/MSX-Basic/mandelbrot-set.basic
Normal file
21
Task/Mandelbrot-set/MSX-Basic/mandelbrot-set.basic
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
100 SCREEN 2
|
||||
110 CLS
|
||||
120 x1 = 256 : y1 = 192
|
||||
130 i1 = -1 : i2 = 1
|
||||
140 r1 = -2 : r2 = 1
|
||||
150 s1 = (r2-r1)/x1 : s2 = (i2-i1)/y1
|
||||
160 FOR y = 0 TO y1
|
||||
170 i3 = i1+s2*y
|
||||
180 FOR x = 0 TO x1
|
||||
190 r3 = r1+s1*x
|
||||
200 z1 = r3 : z2 = i3
|
||||
210 FOR n = 0 TO 30
|
||||
220 a = z1*z1 : b = z2*z2
|
||||
230 IF a+b > 4 GOTO 270
|
||||
240 z2 = 2*z1*z2+i3
|
||||
250 z1 = a-b+r3
|
||||
260 NEXT n
|
||||
270 PSET (x,y),n-16*INT(n/16)
|
||||
280 NEXT x
|
||||
290 NEXT y
|
||||
300 GOTO 300
|
||||
|
|
@ -32,3 +32,9 @@ D[N] = np.log(abs(Z[N])) * abs(Z[N]) / abs(dZ[N])
|
|||
|
||||
plt.imshow(D ** 0.1, cmap=plt.cm.twilight_shifted, origin="lower")
|
||||
plt.savefig("Mandelbrot_set_3.png", dpi=200)
|
||||
|
||||
N, thickness = D > 0, 0.01 # boundary detection and interpolation
|
||||
D[N] = np.maximum(1 - D[N] / thickness, 0)
|
||||
|
||||
plt.imshow(D ** 2.0, cmap=plt.cm.binary, origin="lower")
|
||||
plt.savefig("Mandelbrot_set_4.png", dpi=200)
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ import matplotlib.pyplot as plt
|
|||
d, h = 200, 1200 # pixel density (= image width) and image height
|
||||
n, r = 8000, 10000 # number of iterations and escape radius (r > 2)
|
||||
|
||||
a = -.743643887037158704752191506114774 # real coordinate of the zoom center
|
||||
b = 0.131825904205311970493132056385139 # imaginary coordinate of the center
|
||||
a = -.743643887037158704752191506114774 # try: a, b, n = -1.748764520194788535, 3e-13, 800
|
||||
b = 0.131825904205311970493132056385139 # https://mathr.co.uk/web/m-location-analysis.html
|
||||
|
||||
x = np.linspace(0, 2, num=d+1)
|
||||
y = np.linspace(0, 2 * h / d, num=h+1)
|
||||
|
|
@ -30,8 +30,8 @@ X, Y = C.real, C.imag # zoom images (adjust circle size 100 and zoom level 20 a
|
|||
R, c, z = 100 * (2 / d) * np.pi * np.exp(- B), min(d, h) + 1, max(0, h - d) // 20
|
||||
|
||||
fig, ax = plt.subplots(2, 2, figsize=(12, 12))
|
||||
ax[0, 0].scatter(X[1*z:1*z+c,0:d], Y[1*z:1*z+c,0:d], s=R[0:c,0:d]**2.0, c=D[1*z:1*z+c,0:d]**0.5, cmap=plt.cm.nipy_spectral)
|
||||
ax[0, 1].scatter(X[2*z:2*z+c,0:d], Y[2*z:2*z+c,0:d], s=R[0:c,0:d]**2.0, c=D[2*z:2*z+c,0:d]**0.4, cmap=plt.cm.nipy_spectral)
|
||||
ax[1, 0].scatter(X[3*z:3*z+c,0:d], Y[3*z:3*z+c,0:d], s=R[0:c,0:d]**2.0, c=D[3*z:3*z+c,0:d]**0.3, cmap=plt.cm.nipy_spectral)
|
||||
ax[1, 1].scatter(X[4*z:4*z+c,0:d], Y[4*z:4*z+c,0:d], s=R[0:c,0:d]**2.0, c=D[4*z:4*z+c,0:d]**0.2, cmap=plt.cm.nipy_spectral)
|
||||
ax[0,0].scatter(X[1*z:1*z+c,0:d], Y[1*z:1*z+c,0:d], s=R[0:c,0:d]**2, c=D[1*z:1*z+c,0:d]**.5, cmap=plt.cm.nipy_spectral)
|
||||
ax[0,1].scatter(X[2*z:2*z+c,0:d], Y[2*z:2*z+c,0:d], s=R[0:c,0:d]**2, c=D[2*z:2*z+c,0:d]**.4, cmap=plt.cm.nipy_spectral)
|
||||
ax[1,0].scatter(X[3*z:3*z+c,0:d], Y[3*z:3*z+c,0:d], s=R[0:c,0:d]**2, c=D[3*z:3*z+c,0:d]**.3, cmap=plt.cm.nipy_spectral)
|
||||
ax[1,1].scatter(X[4*z:4*z+c,0:d], Y[4*z:4*z+c,0:d], s=R[0:c,0:d]**2, c=D[4*z:4*z+c,0:d]**.2, cmap=plt.cm.nipy_spectral)
|
||||
plt.savefig("Mercator_Mandelbrot_zoom.png", dpi=100)
|
||||
|
|
|
|||
29
Task/Mandelbrot-set/True-BASIC/mandelbrot-set.basic
Normal file
29
Task/Mandelbrot-set/True-BASIC/mandelbrot-set.basic
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
SET WINDOW 0, 256, 0, 192
|
||||
|
||||
LET x1 = 256/2
|
||||
LET y1 = 192/2
|
||||
LET i1 = -1
|
||||
LET i2 = 1
|
||||
LET r1 = -2
|
||||
LET r2 = 1
|
||||
LET s1 = (r2-r1) / x1
|
||||
LET s2 = (i2-i1) / y1
|
||||
|
||||
FOR y = 0 TO y1 STEP .05
|
||||
LET i3 = i1 + s2 * y
|
||||
FOR x = 0 TO x1 STEP .05
|
||||
LET r3 = r1 + s1 * x
|
||||
LET z1 = r3
|
||||
LET z2 = i3
|
||||
FOR n = 0 TO 30
|
||||
LET a = z1 * z1
|
||||
LET b = z2 * z2
|
||||
IF a+b > 4 THEN EXIT FOR
|
||||
LET z2 = 2 * z1 * z2 + i3
|
||||
LET z1 = a - b + r3
|
||||
NEXT n
|
||||
SET COLOR n - 16*INT(n/16)
|
||||
PLOT POINTS: x,y
|
||||
NEXT x
|
||||
NEXT y
|
||||
END
|
||||
Loading…
Add table
Add a link
Reference in a new issue