Mandelbrot set: Difference between revisions

Content added Content deleted
m (Last improvement: Switched to a quadratic smoothing for the border detection (clearly visible at the antenna))
m (Made two small cuts.)
Line 8,109: Line 8,109:
N = abs.(Z) .>= r # normal map effect 1 (equipotential lines)
N = abs.(Z) .>= r # normal map effect 1 (equipotential lines)
P, Q = S[N] ./ T[N], (S[N] .+ cos.(stripes .* angle.(Z[N]))) ./ (T[N] .+ 1)
P, Q = S[N] ./ T[N], (S[N] .+ cos.(stripes .* angle.(Z[N]))) ./ (T[N] .+ 1)
R = Q .+ (P .- Q) .* log2.(log.(abs.(Z[N])) ./ log(r)) # linear interpolation
U, V = Z[N] ./ dZ[N], 1 .+ (Q .+ (P .- Q) .* log2.(log.(abs.(Z[N])) ./ log(r))) ./ damping
U, V = Z[N] ./ dZ[N], 1 .+ R ./ damping # normal vectors and variations in inclination
U, v = U ./ abs.(U), exp(direction / 180 * pi * im) # unit normal vectors and unit vector
U, v = U ./ abs.(U), exp(direction / 180 * pi * im) # unit vectors
D[N] = max.((real.(U) .* real(v) .+ imag.(U) .* imag(v) .+ V .* height) ./ (1 + height), 0)
D[N] = max.((real.(U) .* real(v) .+ imag.(U) .* imag(v) .+ V .* height) ./ (1 + height), 0)


Line 8,119: Line 8,118:
N = abs.(Z) .> 2 # normal map effect 2 (equidistant lines)
N = abs.(Z) .> 2 # normal map effect 2 (equidistant lines)
U = Z[N] .* dZ[N] .* ((1 .+ log.(abs.(Z[N]))) .* conj.(dZ[N] .^ 2) .- log.(abs.(Z[N])) .* conj.(Z[N] .* ddZ[N]))
U = Z[N] .* dZ[N] .* ((1 .+ log.(abs.(Z[N]))) .* conj.(dZ[N] .^ 2) .- log.(abs.(Z[N])) .* conj.(Z[N] .* ddZ[N]))
U, v = U ./ abs.(U), exp(direction / 180 * pi * im) # unit vectors
U, v = U ./ abs.(U), exp(direction / 180 * pi * im) # unit normal vectors and unit vector
D[N] = max.((real.(U) .* real(v) .+ imag.(U) .* imag(v) .+ height) ./ (1 + height), 0)
D[N] = max.((real.(U) .* real(v) .+ imag.(U) .* imag(v) .+ height) ./ (1 + height), 0)


Line 11,082: Line 11,081:
N = abs(Z) >= r # normal map effect 1 (equipotential lines)
N = abs(Z) >= r # normal map effect 1 (equipotential lines)
P, Q = S[N] / T[N], (S[N] + np.cos(stripes * np.angle(Z[N]))) / (T[N] + 1)
P, Q = S[N] / T[N], (S[N] + np.cos(stripes * np.angle(Z[N]))) / (T[N] + 1)
R = Q + (P - Q) * np.log2(np.log(np.abs(Z[N])) / np.log(r)) # linear interpolation
U, V = Z[N] / dZ[N], 1 + (Q + (P - Q) * np.log2(np.log(np.abs(Z[N])) / np.log(r))) / damping
U, V = Z[N] / dZ[N], 1 + R / damping # normal vectors and variations in inclination
U, v = U / abs(U), np.exp(direction / 180 * np.pi * 1j) # unit normal vectors and unit vector
U, v = U / abs(U), np.exp(direction / 180 * np.pi * 1j) # unit vectors
D[N] = np.maximum((U.real * v.real + U.imag * v.imag + V * height) / (1 + height), 0)
D[N] = np.maximum((U.real * v.real + U.imag * v.imag + V * height) / (1 + height), 0)


Line 11,092: Line 11,090:
N = abs(Z) > 2 # normal map effect 2 (equidistant lines)
N = abs(Z) > 2 # normal map effect 2 (equidistant lines)
U = Z[N] * dZ[N] * ((1 + np.log(abs(Z[N]))) * np.conj(dZ[N] ** 2) - np.log(abs(Z[N])) * np.conj(Z[N] * ddZ[N]))
U = Z[N] * dZ[N] * ((1 + np.log(abs(Z[N]))) * np.conj(dZ[N] ** 2) - np.log(abs(Z[N])) * np.conj(Z[N] * ddZ[N]))
U, v = U / abs(U), np.exp(direction / 180 * np.pi * 1j) # unit vectors
U, v = U / abs(U), np.exp(direction / 180 * np.pi * 1j) # unit normal vectors and unit vector
D[N] = np.maximum((U.real * v.real + U.imag * v.imag + height) / (1 + height), 0)
D[N] = np.maximum((U.real * v.real + U.imag * v.imag + height) / (1 + height), 0)